Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adobe Acrobat Automation
Message
De
29/03/2011 13:02:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01019178
Message ID:
01505383
Vues:
72
Thanks for your fast response. and thanks for your time..
the scenario i am working with is a little different.
I am required to open an acrobat form (a template) that contains multiple fields that require to be filled with data from a vfp set of tables.
After that, save the resulting acrobat form file (not the template) into a folder, close the file and close the template.

here is the code I am working with:

lcSrcFName = 'XXXX Contract Merge.pdf'
lcSrcDir = 'c:\temp\docs\'
lcFileName = Forceext(Addbs(lcSrcDir)+Alltrim(lcSrcFName),'pdf')
If File(lcFileName)
gApp = Createobject("AcroExch.App") && acrobat object
gAVDoc = Createobject("AcroExch.AVDoc") && user interface object
If gAVDoc.Open(lcFileName, "RDM Contract")
gPDDoc = gAVDoc.getPDDoc() && underlying pdf document representation
gApp.minimize(.t.)
gApp.Show
gFrmApp = Createobject("AFormAut.App")
loFields =gFrmApp.Fields

lnFields = loFields.Count()
For Each loField In gFrmApp.Fields
lcFldType = loField.Type
lcFldROnly = loField.Isreadonly
lcFldVal = loField.Value
Do Case
......................... do something with field value, type and readonly properties..
Endcase
Endfor

gPDDoc.Save(1,'d:\mydocuments\rdmcontract'+Dtos(Date())+'.pdf')
Endif
If gApp.getnumavdocs >0
gApp.CloseAllDocs()
Endif
gApp.Hide()
gApp.Exit()
Endif

gPDDoc = .Null.
gAVDoc = .Null.
gFrmApp = .Null.
gApp = .Null.
loField = .Null.
loFields = .Null.
loFItem = .Null.
Return

If I hide acrobat, I can not work with form fields..(error is 'not open document'). minimize and show both of them display the document
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform