Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private void EmbeddPageAsAnIcon(PDFXEdit.IPXC_Document srcDoc, PDFXEdit.IPXC_Document destDoc, PDFXEdit.IPXV_Inst Inst)
{
if (destDoc.HasAcroForm != false)
{
PDFXEdit.IPXC_FormField ff = destDoc.AcroForm.GetFieldByName("Button1");
if (ff != null)
{
PDFXEdit.IPXC_Annotation annot = ff.Widget[0];
PDFXEdit.IPXC_AnnotData_Widget WData = (PDFXEdit.IPXC_AnnotData_Widget)annot.Data;
PDFXEdit.IPXC_Page srcPage = srcDoc.Pages[0];
PDFXEdit.IPXC_XForm xform = destDoc.CreateXFormFromPage(srcPage, (uint)PDFXEdit.PXC_InsertPagesFlags.IPF_Annots_Flatten | (uint)PDFXEdit.PXC_InsertPagesFlags.IPF_Widgets_Flatten | (uint)PDFXEdit.PXC_InsertPagesFlags.IPF_Bookmarks_DoNotCopy | (uint)PDFXEdit.PXC_InsertPagesFlags.IPF_OCG_DoNotCopy);
WData.SetIcon(PDFXEdit.PXC_AnnotAppType.AAT_Normal, xform, true);
WData.ButtonTextPosition = PDFXEdit.PXC_WidgetButtonTextPosition.WidgetText_IconOnly;
annot.Data = WData;
}
destDoc.WriteToFile("D:\\TestFile_res.pdf");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.