Created
May 20, 2016 14:24
-
-
Save Polaringu/464613da40ecd0e7448d4e42fc39038b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void iIXCExperimentsToolStripMenuItem_Click(object sender, EventArgs e) | |
{ | |
PDFXEdit.IIXC_Inst iInst = (PDFXEdit.IIXC_Inst)pdfCtl.Inst.GetExtension("IXC"); | |
PDFXEdit.IIXC_Image iImage = iInst.CreateEmptyImage(); | |
iImage.Load(System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName + "\\Resources\\multipage_tif_example.tif"); | |
int nIndex = 0; | |
while (iImage.PagesCount > 0) | |
{ | |
PDFXEdit.IIXC_Page iPage = iImage.GetPage(0); | |
iImage.RemovePageByIndex(0); | |
iPage.ClearFormatParams(); | |
//To know the correct format parameters use Editor's ImagesTest.exe utility | |
iPage.set_FmtInt((uint)PDFXEdit.IXC_FormatParametersIDS.FP_ID_FORMAT, (uint)PDFXEdit.IXC_ImageFileFormatIDs.FMT_JPEG_ID); | |
iPage.set_FmtInt((uint)PDFXEdit.IXC_FormatParametersIDS.FP_ID_ITYPE, 10); //8Gray image type (According to the ImagesTest Encoders List) | |
iPage.set_FmtInt((uint)PDFXEdit.IXC_FormatParametersIDS.FP_ID_JPEG_QUALITY, 100); | |
iPage.set_FmtInt((uint)PDFXEdit.IXC_FormatParametersIDS.FP_ID_XDPI, 300); | |
iPage.set_FmtInt((uint)PDFXEdit.IXC_FormatParametersIDS.FP_ID_YDPI, 300); | |
PDFXEdit.IIXC_Image tmpImg = iInst.CreateEmptyImage(); | |
tmpImg.InsertPage(iPage); | |
tmpImg.Save(@"C:\Users\polar_000\Pictures\Test\" + Convert.ToString(nIndex++) + ".jpg", PDFXEdit.IXC_CreationDisposition.CreationDisposition_Overwrite); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment