cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert HTML output to pdf output to save the file locally

Former Member
0 Kudos

Hello,

How to convert HTML output developed using wbedynpro java to pdf output automatically after clicking some button which should be useful to save the file locally.

Regards,

Koti Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Hi,

I would recommend using the iText java library. The current version 5.0.6 is completely revamped in order to overcome the flaky rendering behavior of its predecessors.

http://sourceforge.net/projects/itext/

good tutorial at

http://tutorials.jenkov.com/java-itext/index.html

Hope this helps!

Robin van het Hof

Former Member
0 Kudos

Hi

I have webdynpro application which displays output in html form.Understood to use jar file and need to use itext apis to generate pdf output.

I want to create a button in the webdynpro application output/view which should trigger action to use itext jar to generate pdf form of view automatically.

Do I need to create new java application to use itext jar file or can i use itext apis directly in the same webdynpro application strcuture.?

Regards,

Koti Reddy

Qualiture
Active Contributor
0 Kudos

I would recommend creating a new External Library DC, which contains the iText libraries (see http://help.sap.com/saphelp_nw70/helpdata/en/5a/2e2f4234135433e10000000a155106/frameset.htm on how to create an External Library DC)

Then add the public part to your applications Used DC

Hope this explains

Best regards,

Robin van het Hof

Former Member
0 Kudos

Hi,

Created External library using itext jar file and added parts also.In my webdynpo project, added these public parts as used DCs.

I searched forums and find few snippets to generate pdf byextracting data from context nodes. But I want to generate pdf with same content and layout as view automatically . Any code snippets available to achieve this ?

Created a button "Saveaspdf" and assigned action to it.Now I am looking a way for code snippet to call complete layout (view) and generate/convert it into pdf which should allow me to save locally.

Thanks,

Koti Reddy

Qualiture
Active Contributor
0 Kudos

Hi Koty,

I'm not sure if this is possible, but I would suggest to somehow capture the HttpServletResponse of the rendered Web Dynpro view and use it as an inputstream for PDF generation

Best,

Robin van het Hof

Answers (0)