Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adobe Acrobat Automation
Message
From
29/03/2011 13:02:00
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01019178
Message ID:
01505383
Views:
71
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform