These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Acrobat 10 Standard Version and XML imports to Forms

jdgotwald
Registered: Oct 6 2011
Posts: 2
Answered

I have inherited several forms developed in an earlier version of Acrobat, and have the task of creating an automated email responder that must re-constitute the PDF from the XML data that is sent from a user's email client.
 
All was just fine until Windows 7 / Office 2010 / Acrobat 10 came along. Earlier combinations were able to launch Acrobat and using the "SendKeys" method in VBA, we were able to import the XML data into the form and save it to a local file. Acrobat 10 does not offer the [File] [Form Data] [Import Data to Form] menu items (SendKeys was able to send Aft-F, Alt-m, Alt-D to Acrobat 7 and supply the XML file name, but that is not an option in Acrobat 10.
 
Is there a programmatic method that would allow XML data to imported into a form without the sendkeys trickery we've been able to use in the past?

My Product Information:
Acrobat Standard 10.0, Windows
jdgotwald
Registered: Oct 6 2011
Posts: 2
Accepted Answer
I thought I would post the answer I found through other avenues, just in case other members wer looking for the solution (in VB6 code)...

Dim pdfDoc As AcroPDDoc
Dim jso As Object
Dim sPDFName As String
Dim sXMLName As String
Dim sPDFSave As String

sPDFName = "C:\Temp\Original.PDF"
sXMLName = "C:\Temp\NewData.XML"
sPDFSave = "C:\Temp\NewVersion.PDF"
Set pdfDoc = New AcroPDDoc
If pdfDoc.Open(sPDFName) Then
Set jso = pdfDoc.GetJSObject
jso.importXFAData sXMLName
pdfDoc.Save 1, sPDFSave
pdfDoc.Close
End If