Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically delete a page from a PDF
Message
De
03/03/2009 19:25:02
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01385305
Message ID:
01385359
Vues:
73
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform