Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically delete a page from a PDF
Message
From
03/03/2009 19:25:02
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01385305
Message ID:
01385359
Views:
74
Hi Sergey,
I've tested it with Acrobat 7 and worked perfectly.
Thanks for sharing this code.
BTW: Where can I get more stuff about manipulating PDFs
from VFP (create, etc)?


>Hi Tore,
>
>I tested the code with Acrobat 8 but I expect it to work in other versions as well
#DEFINE PDSaveFull	1	&& Write the entire file.

lcPdfFile = "h:\temp\z51.pdf"
lcNewPdfFile = "h:\temp\z51-mod.pdf"

lnPage2DelStart = 1
lnPage2DelEnd = lnPage2DelStart
loAcroApp = CREATEOBJECT("AcroExch.App")
*loAcroApp.Show()
loAVDoc = CREATEOBJECT("AcroExch.AVDoc")
loAVDoc.Open(lcPdfFile, "PDF")

loPDDoc = loAVDoc.GetPDDoc()
loPDDoc.DeletePages(lnPage2DelStart-1, lnPage2DelEnd-1)

loPDDoc.Save(PDSaveFull, lcNewPdfFile)
loPDDoc.Close()

loAVDoc.Close(.T.)
loAcroApp.Exit()
***
TONY Nascimento
*****************

"Your mind is like a parachute. It only works if it is open" - Anthony J. D'Angelo

"The desire to know is natural to good men" - Leonardo da Vinci
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform