cancel
Showing results for 
Search instead for 
Did you mean: 

Saving PDF into a folder on portal WAS

tony_morellet
Participant
0 Kudos

Hi,

I would to save my PDF on the server WAS

1) the user perform the form.

2) an action binding to a button save the data in R3 (this operation is ok)

3) When the safeguard is OK, the same action back up the PDF into a folder on the WAS.

Could you help me for this operation please ?

Accepted Solutions (1)

Accepted Solutions (1)

tony_morellet
Participant
0 Kudos

Anyone can help me

Former Member
0 Kudos

Are you using adobe interactive forms?

kk

tony_morellet
Participant
0 Kudos

Yes I use Interactive form

Former Member
0 Kudos

Hi Tony

Bind the pdfSource property of the InteractiveForm UI element to a context attribute (say PDFSource directly under root node) of type binary.

In the event handler where you want to save this pdf write the following code.

    byte[] content = wdContext.currentContextElement().getPDFSource();
    File file = new File("<AbsoluteFilePathOnServer>" /* ex c:\temp\pdfs\newpdf.pdf */);
    FileOutputStream fileStream = new FileOutputStream(file);
    fileStream.write(content,0,content.length);

I guess this should work.

kk

tony_morellet
Participant
0 Kudos

You have solved my problem.

I missed the line of fileStream.write !!!!!!

Thank you very much.

Answers (0)