Code Example for InsertPages

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

johnwalsh
User
Posts: 2
Joined: Thu Jan 21, 2010 4:25 pm

Code Example for InsertPages

Post by johnwalsh »

Do you have a VB6 code example for the InsertPages method of the ActiveX object?
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Code Example for InsertPages

Post by Corwin - Tracker Sup »

Hi,

To insert empty pages you may use following code:

Code: Select all

Call CoPDFXCview1.SetProperty("Operations.InsertEmptyPages.Count", 1, 0)
Call CoPDFXCview1.SetProperty("Operations.InsertEmptyPages.InsertBefore", 0, 0)
Call CoPDFXCview1.SetProperty("Operations.InsertEmptyPages.PaperMode", "Standard", 0)

Call CoPDFXCview1.SetProperty("Operations.InsertEmptyPages.PaperName", "A4", 0)

Dim vDataOut As Variant
Call CoPDFXCview1.DoVerb("Documents[0]", "InsertEmptyPages", Nothing, vDataOut, PXCVA_NoUI)

Next code is for inserting pages from another PDF document:

Code: Select all

Call CoPDFXCview1.SetProperty("Operations.InsertPages.RangeType", "Exact", 0)
Call CoPDFXCview1.SetProperty("Operations.InsertPages.RangeText", "1,2,3", 0)
Call CoPDFXCview1.SetProperty("Operations.InsertPages.FromExternal", 1, 0)
Call CoPDFXCview1.SetProperty("Operations.InsertPages.File", "e:\PDFs\PDFOverlay5.pdf", 0)
Call CoPDFXCview1.SetProperty("Operations.InsertPages.InsertBefore", 0, 0)
Dim vDataOut As Variant
Call CoPDFXCview1.DoVerb("Documents[0]", "InsertPages", Nothing, vDataOut, PXCVA_NoUI)

HTH.