<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Converting HTML to PDF in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472268#M15280</link>
    <description>&lt;P&gt;Ran into the same once yet I decided to not to resolve it manually and used the tools found through the github forum and some googling. There are dozens of free tool to convert html to pdf but, as you may suggest, all of them are doing so like a crap and there's no chance you could get away with not to edit it manually. I did so with this editing tool &lt;A href="https://ds11.pdffiller.com" target="_blank"&gt;ds11.pdffiller.com&lt;/A&gt; because it's the cheapest one I've found back then. Short of features yet it worth it&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 16:32:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-07-19T16:32:50Z</dc:date>
    <item>
      <title>Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472251#M15263</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have requirement of sending pdf document as an attachment in email. But the scenario is not straight forward. I am getting my data in JSON format from the client, I then convert the JSON to XML and apply XSL transformation to convert to HTML.&lt;/P&gt;&lt;P&gt;I now want to convert the HTML to PDF. Is there any way in ABAP to convert the HTML content to PDF content.&lt;/P&gt;&lt;P&gt;Ex: I get my HTML content something like this in ABAP.&lt;/P&gt;&lt;P&gt;data : lv_html   type string.&lt;/P&gt;&lt;P&gt;lv_html = '&amp;lt;table&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt;Column 1&amp;lt;/td&amp;gt;  &amp;lt;td&amp;gt;Column 2&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;'.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Purayil.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 15:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472251#M15263</guid>
      <dc:creator>purayil_t</dc:creator>
      <dc:date>2017-06-23T15:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472252#M15264</link>
      <description>&lt;P&gt;ABAP systems are not universal converters, they only convert SAP proprietary formats (sapscript, smart forms, ABAP lists). You must use a dedicated software.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 06:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472252#M15264</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-06-24T06:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472253#M15265</link>
      <description>&lt;P&gt;I disagree....&lt;/P&gt;&lt;P&gt;I would get my data into an internal table via a simple transformation.  Then I would output a smartform which is a representation of the document I have to send  to spool and convert the OTF to PDF - all proven technology.&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 06:50:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472253#M15265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-25T06:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472254#M15266</link>
      <description>&lt;P&gt;And something more far fetched - don´t know if it is feasible:&lt;/P&gt;&lt;P&gt;Send HTML via OLE automation to Word and let the desktop application do the conversion.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 13:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472254#M15266</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-06-25T13:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472255#M15267</link>
      <description>&lt;P&gt;I agree, SAP can convert proprietary format OTF (smart forms) to PDF. But not HTML to PDF.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 14:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472255#M15267</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-06-25T14:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472256#M15268</link>
      <description>&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;   I tried this by adding it to internal table and converting to PDF via FM CONVERT_OTF. As Sandra said, it needs to be in an OTF format. The function module gave an error BAD_OTF because the format is incorrect. It expects the contents to be in a particular format in the table OTF with TDPRINTCOM and TDPRINTPAR.&lt;/P&gt;&lt;P&gt;@Sandra, thanks for your reply. I should be looking to do it in Java and call this from ABAP.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Purayil.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:16:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472256#M15268</guid>
      <dc:creator>purayil_t</dc:creator>
      <dc:date>2017-06-26T08:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472257#M15269</link>
      <description>&lt;P&gt;True,  however,  I was proposing an alternative solution.  So my disagreement was not in the fact that you can't convert HTML but in the implication that you can't do it full stop....&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472257#M15269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-26T08:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472258#M15270</link>
      <description>&lt;P&gt;You're missing the smartform output:&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;Then I would output a smartform which is a representation of the document&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;That is where the OTF conversion comes in.&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;I&lt;/EM&gt;&lt;EM&gt; should be looking to do it in Java and call this from ABAP.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;Nope - that just really complicates things and is not needed.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:24:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472258#M15270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-26T08:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472259#M15271</link>
      <description>&lt;P&gt;If you have access to GUI you can load html into CL_GUI_HTML_VIEWER then send it to spool and try to convert spool to pdf with CONVERT_ABAPSPOOLJOB_2_PDF.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:40:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472259#M15271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-26T08:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472260#M15272</link>
      <description>&lt;P&gt;I've converted some of the comments to answers. Just so people know what has happened. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:41:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472260#M15272</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-06-26T08:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472261#M15273</link>
      <description>&lt;P&gt;Hello Richard,&lt;/P&gt;&lt;P&gt;     Thanks for your response, My HTML is dynamic, ABAP does not have any idea of the HTML content.&lt;/P&gt;&lt;P&gt;I don't have much knowledge on smartfomrs, if I am correct the smartfom should have a template which if kind of fixed. &lt;/P&gt;&lt;P&gt;Correct me if I am wrong.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Purayil.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 09:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472261#M15273</guid>
      <dc:creator>purayil_t</dc:creator>
      <dc:date>2017-06-26T09:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472262#M15274</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Is your html a fixed message with variable parts ? If so then a smartforms can handle that easily.  If it is totally dynamic then parse the html, output it to a standard text and use that text in the smartform.  Smartforms are very dynamic.&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 10:20:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472262#M15274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-26T10:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472263#M15275</link>
      <description>&lt;P&gt;That's basically what I am suggesting.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 06:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472263#M15275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-27T06:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472264#M15276</link>
      <description>&lt;P&gt;Hello Richard,&lt;/P&gt;&lt;P&gt;     My HTML is completely dynamic, I have tables, radio buttons, list items etc. and also with CSS. How do you mean to parse it to standard text?&lt;/P&gt;&lt;P&gt;Purayil.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 08:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472264#M15276</guid>
      <dc:creator>purayil_t</dc:creator>
      <dc:date>2017-06-28T08:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472265#M15277</link>
      <description>&lt;P&gt;You can create and read standard texts on the fly using function modules SAVE_TEXT and READ_TEXT.  You say it is completely dynamic - Surely it must conform to some sort of structure ?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 08:19:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472265#M15277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-06-28T08:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472266#M15278</link>
      <description>&lt;P&gt;Hi Purayil,&lt;/P&gt;
  &lt;P&gt;Did you solve your issue? Can you please share your solution? Many thanks.&lt;/P&gt;
  &lt;P&gt;I tried sending HTML to smartform and generated smartform output from spool into PDF but unfortunately it is in HTML. Smartform print it as html string with tags. I think we need some kind of container to render html and get output from there, but in WebUI we can not use CL_GUI_HTML_VIEWER. Any other idea?&lt;/P&gt;
  &lt;P&gt;BR,&lt;/P&gt;
  &lt;P&gt;Tauqir&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 08:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472266#M15278</guid>
      <dc:creator>tauqiram</dc:creator>
      <dc:date>2017-11-10T08:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472267#M15279</link>
      <description>&lt;P&gt;I had this requirement too some time ago. In my case, I had to combine several html files into one PDF file. To achieve this, I used a 3rd party command line tool named wkhtmltopdf (https://wkhtmltopdf.org , &lt;A href="https://github.com/wkhtmltopdf/wkhtmltopdf)" target="test_blank"&gt;https://github.com/wkhtmltopdf/wkhtmltopdf)&lt;/A&gt;. To use it, you save the html files to a folder, then run this command line tool with the names of the files and a .pdf file name. Then you read the generated pdf file.&lt;/P&gt;
  &lt;P&gt;Since it doesn't need to display anything, it can run in the background. I have created a web service which has html file contents as input (array of string) and pdf content as output (xstring). It runs on Tomcat on a separate server. I call that web service from Abap.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 11:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472267#M15279</guid>
      <dc:creator>dagni</dc:creator>
      <dc:date>2017-11-22T11:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472268#M15280</link>
      <description>&lt;P&gt;Ran into the same once yet I decided to not to resolve it manually and used the tools found through the github forum and some googling. There are dozens of free tool to convert html to pdf but, as you may suggest, all of them are doing so like a crap and there's no chance you could get away with not to edit it manually. I did so with this editing tool &lt;A href="https://ds11.pdffiller.com" target="_blank"&gt;ds11.pdffiller.com&lt;/A&gt; because it's the cheapest one I've found back then. Short of features yet it worth it&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/472268#M15280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-19T16:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Converting HTML to PDF in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/14016531#M2038520</link>
      <description>&lt;P&gt;Hi Purayil,&lt;/P&gt;&lt;P&gt;ABAP doesn’t offer a built-in way to convert arbitrary HTML to PDF—it mainly supports conversion for SAP-specific formats like Smart Forms, SAPscript, or ALV lists. For your case, where you're working with dynamic HTML, you'll need to use an external solution.&lt;/P&gt;&lt;P&gt;One option is to use a dedicated HTML-to-PDF conversion API, such as &lt;A href="https://pdfbolt.com" target="_new" rel="noopener"&gt;PDFBolt&lt;/A&gt;. With such an API, you can send your HTML content via an HTTP request and receive a PDF in response, which you can then attach to your email using ABAP’s standard emailing functions (e.g., BCS).&lt;/P&gt;&lt;P&gt;Alternatively, if your environment allows, you might set up a command-line tool on your server that performs the conversion, and then call that tool from ABAP.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 21:11:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-html-to-pdf-in-abap/m-p/14016531#M2038520</guid>
      <dc:creator>Ametrin</dc:creator>
      <dc:date>2025-02-13T21:11:46Z</dc:date>
    </item>
  </channel>
</rss>

