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

XML to PDF

brobbsnet
Registered: Jan 9 2007
Posts: 4

I have an Issue with trying to get eidtable pdf to fill itself when I pass an XML String to it from a web application. The submit function cannot be Used here , because I am coming from inside the web application, i will like to Open a new pdf browser window showing the pdf with my XML data already filled in. something like
[link=http://myserver:1010/browse.pdf]http://myserver:1010/browse.pdf[/link]
where I pass my XML String to browse.pdf and have the PDF document read in the values from the XML. I just want to open a target PDF document in a browser and have it read the values from XML String. is this possible ? and How can I do that ? Any thoughts ?
How does a PDF accepts an XML string and reads the values from the XML string into its Fields ?

My Product Information:
Acrobat Pro 7, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The only XML that Acrobat will read and automatically populate a PDF with is XFDF. That's it. You can pass some more generic XML back to Acrobat on a submitForm() call, but if you just want Acrobat to say, "Hey, there's some data and I'm going to load it", then you have to use FDF or XFDF. So here's the trick. You set your web link to point to an XFDF or FDF file instead of the PDF. For more dynamic action you can use Browser JavaScript to create an Object tag that points to the XFDF. For example, say you have a web page with 3 different buttons on it. Each button should activate a different dataset. When the button is pushed it sets the 'innerHTML' of a 'div' tag to be an 'object' tag that loads the XFDF. Mime types are important. The object Mime type must be set to PDF, even though your loading XFDF. You can make this way more dynamic with an ASP or other server side script. I've built ASP scripts that save form data and then reload it later at the user's request.

Cheers,
Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://partners.adobe.com/public/developer/en/acrobat/sdk/
pdf/javascript/AcroJS.pdf]Acrobat JavaScript Reference[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

humayoo
Registered: May 18 2009
Posts: 12
Hello,

i have big problem.the event.target.submitForm() and submit button perfectly working on windows.

but event.target.submitForm() and submit button did not work on mac os .it gave th error "cannot process the content of type text/html;charset=utf-8".

below are the my code,please help me that ,how will it work on mac.

app.alert("Vänta, det tar en liten stund för bilden att laddas upp och beskäras. Din PDF kommer att laddas om.",3,0);
event.target.submitForm({cURL:"http://62.119.142.107/alstra/submit_data_forimage.php",cSubmitAs: "XML",cCharset:"UTF-8"});

thanks
Humayoo