Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

reload XDP or XML

Avatar

Former Community Member
is it possible to reload an XDP or XML data using importData through a URL? ex:- &host.importData("http://localhost/PDF/data.Xml")



I just want to load this XML from a web server rather than a local drive.
5 Replies

Avatar

Level 6
Sajid,



I don´t have sure if I understood your question, but if you have an opened PDF with data and you want to merge data on it again, I think you will not be able to do it so easily.



You could however, make a get() call (formcalc function) to the server (you can pass parameters via query string), receive a xml response back and then merge the data by yourself using a script inside the PDF. Note, however, as I already realized, that you are limited to more or less 2000 bytes in IE.



This solution works with reader and you will be able to maintain your pdf opened.



Other solution would be to point to another XDP file... The user will see the page "reloading", however.



Any other solution I think you will need reader extensions, and even with this tool I don´t know if it is possible to do what you want.

Avatar

Former Community Member
Hi Neptuno,



Thanks for your answer..



>>You could however, make a get() call (formcalc function) to the server (you can pass parameters via query string), receive a xml response back and then merge the data by yourself using a script inside the PDF



I have no clue how to get the data through FormCalc.. any sample script will be highly helpful for me...



once again thansk a lot..

Avatar

Level 6
Hello,



You can look in the Designer for help on this.

At the place where you want to get the data make a call like this in code (choosing FormCalc script and not Javascript):



var data = Get("http://myIP/Service/service1.asmx/WebFunction")

$host.message(data)//See the received data



var myxml = XMLData.parse(data, false); //Create a XML structure in memory



In this web function (asp.net for instance), just send a string with your data. You will receive in the designer a xml structure.



Note: this only woks with reader. With Acrobat Professional you will get a message saying this only works with certified forms... Don´t know why, but I believe this shoudn´t work with reader too... :)



Regards

Avatar

Former Community Member
But after getting in the memory, how to I bind it? my problem is image data. I can set all text values without issues.. I crack my head on this for a week.. :( if nothing works out i will drop the whole PDF idea and go for infoPath.. looks so cool and feature rich..