Is there any way to convert an html to pdf? I can not use Html2PDF Converter because it needs an URL and I don´t want to pass the URL, I want to generate my own HTML and convert it.


Thanks.

Adrian Poveda Sanchis wrote:

Is there any way to convert an html to pdf? I can not use Html2PDF Converter because it needs an URL and I don´t want to pass the URL, I want to generate my own HTML and convert it.


Thanks.

Hello Adrian,

You can use this component: 

https://www.outsystems.com/forge/component-overview/3658/conversion-of-html-text-xml-to-pdf-format

Jorge Rodrigues


Hi Adrian,

From what I gather, a lot of libraries will let you input an HTML file instead of an URL - wkhtmltopdf, the library used for Html2PDF lets you do this. You'd have to adapt the OutSystems component or ask the authors to implement this. You'll probably suffer performance-wise since you'd have to juggle temporary files in the server.

Why do you need to generate your own HTML outside of OutSystems? You could simplify your PDF page and remove its Theme - the only thing left would be the bare minimum HTML and JS OutSystems generates, and this shouldn't have an impact in your PDF.

Hello Adrian,
you can use Html2PDF you just have to some "juggle". Let's see it.

Create a blank screen and one text variable.
In screen preparation you can create your own html and assign to that variable.


So, use TextToBinary convert your string and than do download of that.


Set up "Save To Disk" to NO and change Mime-Type to "text/html"

From now, when you request that page the HTML response will be that you have created.



Best Regards,
Paulo Fagundes