cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Adobe Interactive Form in background and setpdfSource value.

Former Member
0 Kudos

Hi,

Is there any way to create Adobe Interactive Form in the background assigning R/3 data (without displaying) and assign pdfSource binary information in context attribute and later, display Adobe Interactive Form using pdfSource context attribute in a new window?

if Adobe Interactive Form is in Visible state, I'm also able to display Adobe Interactive Form in a new window using pdfSource binary context attribute, .

But, unable to create Adobe Interactive form in the background when Adobe Interactive Form Visibility is NONE and unable to assign binary data to pdfSource attribute in context and hence unable to display Adobe Interactive Form in a new window. Kindly help me if this process is possible.

Thank you in advance.

Regards

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

Sigiswald
Contributor
0 Kudos

Hi Prasad,

This is certainly possible. First populate the dataSource context node with the data (e.g. coming from R/3). Then use <a href="http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/api/WDInteractiveFormHelper.html">WDInteractiveFormHelper.getContextDataAsStream</a> to obtain the data.xml as a byte[] by calling toByteArray() on the ByteArrayOutputStream. The next step is to obtain the xdp template as a byte[] (I don't know exactly how to do this, but it's certainly possible using some API, just as you would read other resources deployed within your Web Dynpro). When you have both the template and the data, you can use the <a href="http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/api/package-summary.html">PDFDocument</a> API to render a PDF, something as <i>WDPDFDocumentFactory.getDocumentHandler().getDocumentContext().getDocumentCreationContext()</i>; set the data and the template and other options like interactive, call execute and retrieve the pdf byte[] from the returned object. Eventually you can assign the pdf byte[] to the pdfSource context attribute. In case you use NW04, you must use the <a href="http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/pdfobject/api/package-summary.html">PDFObject</a> instead.

Besides, why would you want to create the PDF before displaying it?

Kind regards,

Sigiswald