cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a pdf-document out of a function module

Former Member
0 Kudos

hy,

we want to create a wd-application which imports a function module. The function module creates a pdf-document. We are planning to deliver the function-module output as a table to webdynpro. The table includes the pdf-document.

How can we display this pdf within the browser ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

at first your Function Module should deliver your PDF as an XSTRING in ABAB.

This is mapped to a byte[] in Java Model. This byte array you can bind for example to a FileDownload Element in the GUI. If you click on it the PDF opens.

On the context element of type byte[] you have to do the following:

IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("<byte[]contextElement>");    
IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();

binaryType.setFileName("<yourname>".pdf");
binaryType.setMimeType(WDWebResourceType.PDF);

Then it should basically work

Frank