Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Convert HTML File to PDF

Former Member
0 Kudos
2,434

Hi Friends,

I am downloading the HTML file from my ABAP report. It will contain HTML tags ( i.e for Table, Pictures ). Here Pictures are coming from DMS Server. It is downloading on the presentation server perfectly.

Now Customer wants to download that as a PDF. I tried in SDN and Funtion Modules from ABAP. But i did not get any solution.

Can anyone suggest how we can convert the file as PDF from ABAP.

If not possible How can i call external conversion ( i.e Java, PHP ) from ABAP.

Regards,

Srinivas Bhavanam

8 REPLIES 8

suman_pr
Active Participant
0 Kudos
289

Hi,

One way is to submit the report to the Print Spool like where p_repid is your report id which you want to convert.

-


submit (p_repid) to sap-spool without spool dynpro

spool parameters mstr_print_parms

via selection-screen

and return.

-


Then convert Spool to PDF using the function module "CONVERT_ABAPSPOOLJOB_2_PDF"

Finally, download the file using the function module "DOWNLOAD"

Hope this helps.

Suman

Former Member
0 Kudos
289

Hi Suman,

Thanks for your quick response.

I am preparing HTML code and passing it to my internal table. Then i am dowloading and excuting with forntend classes. Here i am confused about how it will go to the spool.

Regards,

Srinivas Bhavanam

Former Member
0 Kudos
289

hi

see the following given link

[;

hope this helps

Regards

Ritesh

0 Kudos
289

Hi Ritesh,

I have gone through the link. I know advantage of layouts. Here i want to display DMS Server pictures which are there in JPG format. That is why i am going through the HTML page design.

Regards,

Srinivas Bhavanam

0 Kudos
289

Hi Srinivas,

I have the same requirement and the same issue.

Were you able to convert the HTML file to PDF?

Thanks,

Oscar

0 Kudos
289

Put o/p html file on server using dataset. Write a server script/command to convert to pdf file. Server script should be capable of converting your html to pdf and embed images on pdf file. Use New generated PDF file, store it on spool or print it.

Regards,

Nitesh

saradas
Explorer
0 Kudos
289

I am trying to achieve the same.

Any help is appreciated.

rosenberg_eitan
Active Contributor
0 Kudos
289

Hi,

In this article I show how to create native Excel using ABAP and Java.

http://scn.sap.com/community/abap/blog/2013/12/15/creating-excel-the-java-way

There are some Java PDF library that can be used:

http://pdfbox.apache.org/

http://itextpdf.com/

http://java-source.net/open-source/pdf-libraries.

Also google for html to pdf convertors

Regards.