Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

converting a xdp (xml variable) to pdf

Avatar

Level 6
Hello,



In my process I need to transform a xdp file (the template part). For that, Im getting a xdp file from the repository to a xml variable. Then I apply a xslt template on that xdp and get a new xdp (in a xml variable). Finally I want to render this xdp to a pdf file, and this is where I get an error saying I need to give a content root ID. However, since Im trying to feed the form service with a template stream (in a xml variable) I dont have any content root... I believe I would be able to save the xdp variable to disk and then give a url to formservice, but I rather work only in memory, using variables.



Any idea on this?



thank you
4 Replies

Avatar

Level 10
"However, since Im trying to feed the form service with a template stream (in a xml variable) I dont have any content root."



If you feed the form service with a template stream, you need to pass it as part of the "Form Data" parameter of the renderPDFForm operation and not the "Form to Render" parameter.



If you specify something in the "Form to Render", it'll expect a Content Root URI.



Jasmin

Avatar

Level 6
Jasmin,



It worked well thank you :)



But I was wondering: if I need to pass the xml variable with the xfa template as part of the "Form Data" parameter, how can I pass the data part of the form to make a merge with the template? Do I need to create a second step in my process that will take this output PDF file (in a variable) and a data file, or is it possible to make this merge in the same step? (for instance, feeding the xfa template with a datset node)



Thank you

Avatar

Level 10
"But I was wondering: if I need to pass the xml variable with the xfa template as part of the "Form Data" parameter, how can I pass the data part of the form to make a merge with the template?"



XDP data can contain both the template and the data. You can pass both at the same time.



Jasmin

Avatar

Level 6
Jasmin,



One more thing: because I´m referencing fragsments in this dynamically created xdp form, the process is not resolving the fragments right. I understand that if I give a document path, the fragments would be resolved based in this base path, however, in my case I dont have a base path...



Thank you