cancel
Showing results for 
Search instead for 
Did you mean: 

Get PDF using FileDownload UI

Former Member
0 Kudos

Hi,

Any pointers to documentation which shows step by step creation of a WD application, for downloading PDF using the FileDownload UI.

I have a WD application which calls a BAPI. This BAPI returns one parameter (BIN_FILE) which is of type XSTRING. This paramter contains the PDF content. I need to use this to be downloaded to a pdf.

Can anyone guide me how to do it. I used the recent posts for this but seems to loose track somewhere.

Regards

Puneet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

create a context element of type binary for example FileDownload.

In doInit() metod:

IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("FileDownload");

IWDModifiableBinaryType binaryType;

binaryType = (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();

binaryType.setFileName("test.pdf");

binaryType.setMimeType(WDWebResourceType.pdf);

you xstring is for example "file"

try

{

int length =(int)file.length();

byte b[] = new byte[length];

b = file.getBytes();

wdContext.currentContextElement().setFileDownload(b);

}

catch(Exception ex)

{ }

Andrea

Answers (0)