Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Is it possible to use a form variable (in memory) as input to render pdf?

Clookes
Level 3
Level 3
Hi,



I understand that the render to PDF service takes URI as input, but what if I have a xdp form modified and stored in memory, and would like to use that to render PDF, how can this be done?



Thakns in advance.
6 Replies
Jasmin_Charbonn
Level 10
Level 10
You can pass the XDP in a document variable type as part of the data parameter. In that case, you can leave the form url blank.



Jasmin
Clookes
Level 3
Level 3
Hi Jasmine,



Thanks for the tip. So, is this what I need to do?



I have an xdp form in the repository, and xml data I generate from a custom component.



1. render the pdf form (merge xdp (no data) with xml data)

2. convert pdf back to xdp (this xdp now includes data) and stored as a document variable in memory

3. manipulate the xdp (via custom component)

4. render the pdf form by passing the xdp (from step 3) in a document variable type as part of the data parameter, leaving URL blank.

5. write pdf to disk



This would work right? Is there another way?



Thanks in advance.
Jasmin_Charbonn
Level 10
Level 10
I'm not entirely clear as why you want to render it a second time.



What type of manipualtion are you doing in step 3.



Jasmin
Clookes
Level 3
Level 3
Adding "access" attribute and/or setting it to "readOnly" in most "fields" elements.
Jasmin_Charbonn
Level 10
Level 10
If it was me, I would have a hidden field on the xdp that gets populated form the data from your custom component or from a setValue in the process, then have some script on the forms that disables all the fields based on the value of that fields.



Jasmin
Clookes
Level 3
Level 3
Ya that's what I did actually, originally, but they (client) didn't like that apparently, they didn't want to have put this invisible field and java script in their xdp templates, so I am just trying to get around it.



Thanks for your help. 🙂