[HTML2PDF] HTML2PDF 2021 PDF not created
html2pdf
Forge component by Miguel 'Kelter' Antunes
Application Type
Reactive
Service Studio Version
11.10.19 (Build 41208)

I installed HTML2PDF component which was advertised as easy way to create pdfs. I haven't been able to produce a single working file. 

My file is printed completely blank. I created a button and the content of the button is shown in the screenshots below. This should be simple enough but the result is not what I expect. Can you help me? What do I do wrong? I have also tried GeneratePDF_Advanced action but the outcome wasn't any better. I have also tried several URLs unsuccessfully. If I add HTML code to HTML input field PDF will be generated with that code. It seems that the action is completely ignoring the URL.

mvp_badge
MVP
Solution

Hi all,

You should understand the limitations of the underlying technologies. HTML2PDF works on top of wkhtmltopdf. To further investigate your problems I advise you to look for similar problems and information in the following sites:

wkhtmltopdf is known to have some limitations with modern website technologies, that's why you're having issues when trying to generate PDFs out of websites and reactive OutSystems screens.

HTML2PDF was built to simplify the process of setup and PDF creation from its previous component Html2PdfConverter. The underlying library is the same.

HTML2PDF was also built to support the creation of reports, not for full sites exports to PDFs. Reports should be built with care and simplicity, like you need to do with emails, to have as much compatibility as possible with all the clients.

HTML2PDF only supports and will only support OutSystems Traditional Web Screens. 

Hope that everything is clear by now. As others point it out, there are other alternatives to try out and explore.

Cheers,
Miguel

Solution


HI Jussi Ahonen ,

Here you go ! I have used UltimatePDF component to download the pdfs and it worked smoothly as i too have used it before.

But out of curiosity, i too tried to generate pdf via component "HTML2PDF " by various ways but it didn't work. There is defiantly an issue with the component "HTML2PDF " !!

Please find attached oml.

Hope this solves your issue :)

Thanks,

Vani

PDFTest.oml

Hi Jusi,


I tried to replicate your scenario with different URLs.


cnn.com - empty(blank) pdf

google.com - successfully generated

yahoo.com - nothing happens

facebook.com / twitter.com  - successfully generated but there seems to be a problem with the file


There might be a problem in the extension (not sure, though). 

You could also try different URLs here


Regards,


 

Hi Marco

My sample consisted of few pages that didn't work. But interesting that some work and some don't. Google and some others worked for me as well. 

My original goal is to create pdf of my own page created by Outsystems and that hasn't yet worked either. My page have anonymous role ticked, I have tried to set page public but the result is always the same

Pdf says "There was an error processing your request".

HI Jussi Ahonen,

Seems everything correct ! Please share oml to look into the issue further.

Thanks,

Vani


Hi @Vani Mankad 

The previous app was part of my company's app and I don't dare to share it so I used my personal environment and created the simplest possible code for testing creating PDF. One button to create pdf of current page and another but for creating it from the other Outsystems page (containing one text sentence). In both cases pdf's were blank (so no error message at this time?).

OML file enclosed.

PDFTestJussi.oml

Solution


HI Jussi Ahonen ,

Here you go ! I have used UltimatePDF component to download the pdfs and it worked smoothly as i too have used it before.

But out of curiosity, i too tried to generate pdf via component "HTML2PDF " by various ways but it didn't work. There is defiantly an issue with the component "HTML2PDF " !!

Please find attached oml.

Hope this solves your issue :)

Thanks,

Vani

PDFTest.oml

Thank you @Vani Mankad! That solution seems to work at least in this context. I will try to implement this to my actual app.

@Miguel 'Kelter' Antunes I hope HTML2PDF will be fixed because it seems that I am not the only one having problems with it. Basied on the comments in component's page it seems to be great component.

I have tested like 5 or 6 different forge component for creating pdfs and that UltimatePDF is the first one that actually works like it should (for Reactive Web). Thanks!

Hi @Jussi Ahonen 

Check the error in the servicecenter and share it, please in order we can understand the issue.

Regards,

Gonçalo Almeida

Hi @Goncalo Almeida 

There are no errors in service center concerning this. Only error message in pdf

Jussi

Hello @Jussi Ahonen,

If you are not compelled to only use HTML2PDF then I would recommend saving time troubleshooting the root cause. I recommend Ultimate PDF as I have found it to be a non hassle, easy to use component that supports latest web standards in contrast to wkhtmltopdf. The outputs are predictably the same as the print preview from a browser. 

I have been able to use it in Reactive applications as well though this is not specifically mentioned on the component page in the Forge.

Try it out for yourself as you have the option to install a demo as well.

Best regards,

AJ

Hi @=AJ= 

I definitely am not compelled or tied to any specific component. My only intention is to get pdf created out of HTML page (or in any other method using Outsystem data). I will check that out. Thanks!

Jussi

Hi Jussi,

I have just realized that Ultimate PDF's UI Flow features are not available in Reactive Web apps. 

So I wanted to immediately update my previous post for accuracy. I had typically used just the server actions which are available in both Traditional and Reactive web apps so I did not realize this earlier.

Regards

AJ

mvp_badge
MVP
Solution

Hi all,

You should understand the limitations of the underlying technologies. HTML2PDF works on top of wkhtmltopdf. To further investigate your problems I advise you to look for similar problems and information in the following sites:

wkhtmltopdf is known to have some limitations with modern website technologies, that's why you're having issues when trying to generate PDFs out of websites and reactive OutSystems screens.

HTML2PDF was built to simplify the process of setup and PDF creation from its previous component Html2PdfConverter. The underlying library is the same.

HTML2PDF was also built to support the creation of reports, not for full sites exports to PDFs. Reports should be built with care and simplicity, like you need to do with emails, to have as much compatibility as possible with all the clients.

HTML2PDF only supports and will only support OutSystems Traditional Web Screens. 

Hope that everything is clear by now. As others point it out, there are other alternatives to try out and explore.

Cheers,
Miguel

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.