Skip to content

Instantly share code, notes, and snippets.

@Polaringu
Created May 20, 2016 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Polaringu/464613da40ecd0e7448d4e42fc39038b to your computer and use it in GitHub Desktop.
Save Polaringu/464613da40ecd0e7448d4e42fc39038b to your computer and use it in GitHub Desktop.
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