cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a filled PDF as File

thomas_ahues
Discoverer
0 Kudos

Hi all,

I'm working with ADS on CE7.11. with the actual API

( com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api ).

Please can someone tell me how to save the actual filled PDF to the filesystem.

There are lots of samples with the deprecated api, but none with the actual one.

Now I get a PDFObjectRuntimeException.

Best Regards..

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_ahues
Discoverer
0 Kudos

Hi all, after lots of hours I found a solution for myself.....

Please do not forget to set the a context-pdfSource-attribute to binary and bind it to the datasource...

IPrivatePdfCompView.IContextElement contextElement = wdContext.currentContextElement();

byte[] bytes = contextElement.getPdfSource();

try

{

File file = new File(filename);

FileOutputStream os = new FileOutputStream(file);

os.write(bytes);

os.close();

}

catch (IOException e)

{

// do something

e.printStackTrace();

}

Regrads Thomas