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
//C# | |
private void ResizePageToA2(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) | |
{ | |
if (pDoc == null) | |
return; | |
int nID = pInst.Str2ID("op.document.resizePages", false); | |
PDFXEdit.IOperation pOp = pInst.CreateOp(nID); | |
PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | |
input.v = pDoc; | |
PDFXEdit.ICabNode options = pOp.Params.Root["Options"]; |
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 verifyPageLinksToolStripMenuItem_Click(object sender, EventArgs e) | |
{ | |
if (pdfCtl.Doc == null) | |
return; | |
uint GoTo = pxsInst.StrToAtom("GoTo"); | |
uint GoToR = pxsInst.StrToAtom("GoToR"); | |
uint Launch = pxsInst.StrToAtom("Launch"); | |
uint invalidCount = 0; | |
for (uint i = 0; i < pdfCtl.Doc.CoreDoc.Pages.Count; i++) | |
{ |
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 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]; |
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
public void InitializeTwoControls() | |
{ | |
//First frame will be with full Control functionality | |
PDFXEdit.IPXV_MainFrame firstMainFrame = pdfCtl.Inst.MainFrm[0]; | |
PDFXEdit.IPXV_MainView firstMainView = firstMainFrame.View; | |
PDFXEdit.IPXC_Document doc = pxcInst.OpenDocumentFromFile("D:\\TestFile.pdf", null, null); | |
firstMainFrame.OpenDocFrom(doc); | |
firstMainView.CmdPaneTop.Show(); | |
//Setting up preview frame |
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
SourceCtrl.OpenDocFromPath(appRootDir + "\\SP.pdf"); | |
PDFXEdit.IPXV_Document sourceDoc = SourceCtrl.Doc; | |
DestinationCtrl.OpenDocFromPath(appRootDir + "\\SF.pdf"); | |
EmbeddPageAsAnIcon(sourceDoc.CoreDoc, DestinationCtrl.Doc.CoreDoc, DestinationCtrl.Inst); |
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 changeAnnotationScaleToolStripMenuItem_Click(object sender, EventArgs e) | |
{ | |
PDFXEdit.IPXC_Annotation annot = pdfCtl.Doc.CoreDoc.Pages[0].GetAnnot(0); | |
PDFXEdit.IPXC_AnnotData_Poly PData = (PDFXEdit.IPXC_AnnotData_Poly)annot.Data; | |
PDFXEdit.IPXC_MeasureRL measure = (PDFXEdit.IPXC_MeasureRL)PData.Measure; | |
//We'll set the scale from 33mm to 11m | |
measure.Ratio = "33 mm = 11 m"; | |
PDFXEdit.IPXC_NumberFormatArray nfa = measure.GetX(); | |
PDFXEdit.IPXC_NumberFormatItem nfi = nfa.CreateNewItem(); | |
nfi.FractionType = PDFXEdit.PXC_MeasureFractionType.MFT_AsDecimal; |
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 PDFXEdit.PXC_Matrix Multiply(PDFXEdit.PXC_Matrix m1, PDFXEdit.PXC_Matrix m2) | |
{ | |
double t0 = (double)(m1.a * m2.a + m1.b * m2.c); | |
double t2 = (double)(m1.c * m2.a + m1.d * m2.c); | |
double t4 = (double)(m1.e * m2.a + m1.f * m2.c + m2.e); | |
m1.b = (double)(m1.a * m2.b + m1.b * m2.d); | |
m1.d = (double)(m1.c * m2.b + m1.d * m2.d); | |
m1.f = (double)(m1.e * m2.b + m1.f * m2.d + m2.f); | |
m1.a = t0; | |
m1.c = t2; |
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
PDFXEdit.ICab openParams = m_Inst.CreateOpenDocParams(); | |
PDFXEdit.ICabNode openParamsRoot = openParams.Root; | |
openParamsRoot.SetBool("NoProgress", true); | |
m_Inst.ActiveMainFrm.OpenDocFromPath(ofd.FileName, openParams); |
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
uint m_nImagesCount = 0; | |
private void CountImageTypeContentItems(PDFXEdit.IPXC_Document srcDoc, PDFXEdit.IPXC_Content content) | |
{ | |
//Getting image or inline image types of the content items | |
for (uint j = 0; j < content.Items.Count; j++) | |
{ | |
PDFXEdit.IPXC_ContentItem ci = content.Items[j]; | |
if ((ci.Type == PDFXEdit.PXC_CIType.CIT_Image) || (ci.Type == PDFXEdit.PXC_CIType.CIT_InlineImage)) | |
{ |
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
public partial class CustomEventTarget: | |
PDFXEdit.IUIX_ObjImpl, | |
IDisposable | |
{ | |
//Here we push custom implementation of the PagesView | |
public CustomEventTarget(PDFXEdit.IUIX_Obj obj, MainFrm parentForm) | |
{ | |
Obj_ = obj; | |
if (Obj_ != null) | |
Obj_.PushImpl(this); |
OlderNewer