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.

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

Avatar

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

Avatar

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

Avatar

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.

Avatar

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

Avatar

Level 3
Adding "access" attribute and/or setting it to "readOnly" in most "fields" elements.

Avatar

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

Avatar

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. :)