[Html2PdfConverter] Error message when trying to convert to pdf

Forge Component
(61)
Published on 17 May by Guilherme Pereira
61 votes
Published on 17 May by Guilherme Pereira

I'm receiving the following error message when trying to convert to pdf:


And here's my Administration setup if that helps:



Also, here's everything that was in my bin folder after installing wkhtmltopdf:

Also, this is using OutSystems 10.0.1005.1 and this is for a Web application.

Hi Sam,


Are you using a cloud or OnPremises infrastructure? If you're using cloud then you should not use that version as it requires MSVC that may not be installed on the machine. 

Can you try with the MINGW version?

Your admin page should look something like:


Cheers,

Guilherme

Guilherme Pereira wrote:

Hi Sam,


Are you using a cloud or OnPremises infrastructure? If you're using cloud then you should not use that version as it requires MSVC that may not be installed on the machine. 

Can you try with the MINGW version?

Your admin page should look something like:


Cheers,

Guilherme

That's the version I downloaded but I'm not seeing those dll files besides the one in my screenshot.  This is the version I installed:


Think I installed the incorrect one.  I just saw another MINGW version after scrolling down the page in the Bleeding Edge section so I'm giving that a try.

Now I'm getting a different error message:


And here's my Administration setup:


I added the wkhtmltox.dll but I tried before and after and I still received the same error message:

HI,


It should be the bleeding Edge (without wkhtmltox) and also you can enable DebugMessages to see if we have additional logging.

Other than that I recommend you to try and generated the pdf from your local pc with the same version you uploaded and see if it works.


Cheers,

Guilherme

Guilherme Pereira wrote:

HI,


It should be the bleeding Edge (without wkhtmltox) and also you can enable DebugMessages to see if we have additional logging.

Other than that I recommend you to try and generated the pdf from your local pc with the same version you uploaded and see if it works.


Cheers,

Guilherme

How do I generate the pdf on my local pc?


Hi,


You need to use the command line. You can check the parameters on wkhtmltopdf documentation page: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt


Cheers,

Guilherme

Guilherme Pereira wrote:

Hi,


You need to use the command line. You can check the parameters on wkhtmltopdf documentation page: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt


Cheers,

Guilherme

Okay, I've tried to run it locally on my computer but I'm getting different error messages.  Not sure if I'm passing in the correct parameters but you can see below.  The first attempt was without using "--load-error-handling ignore" as a parameter.  The 2nd attempt was trying to convert to pdf and the third attempt was trying to convert to an image.  The pdf I'm attempting to use is located here https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf.  After I started using the ignore parameter, the file was created but it's a blank file due to the page load failing.

 


Hi Sam,


That probably means that is not only a configuration problem but you have something in your page that is preventing the generation (in the past there were incompatibilities with some silk css and this may be similar).


I recommend you to try and use the component now and use the ignore errors flag and see if you get the same page. That will indicate if the configuration is correct or not.


After that you can try a new webflow based on an empty theme and add pieces of your page sequentially until you find the piece of script / page that could be causing the issue. You may also check the faq for additional assitance.


Cheers,

Guilherme

Guilherme Pereira wrote:

Hi Sam,


That probably means that is not only a configuration problem but you have something in your page that is preventing the generation (in the past there were incompatibilities with some silk css and this may be similar).


I recommend you to try and use the component now and use the ignore errors flag and see if you get the same page. That will indicate if the configuration is correct or not.


After that you can try a new webflow based on an empty theme and add pieces of your page sequentially until you find the piece of script / page that could be causing the issue. You may also check the faq for additional assitance.


Cheers,

Guilherme


But using the "ignore error flag" only produced a blank file for me.  Also, I'm using the <espace>/HtmlToPdfConverter/HowToPDF.aspx to test the conversion before trying the command line approach and that didn't work either.  Are you saying there could be some css issues with the HTMLToPdfConverter app?

Hi,


It shouldn’t have any issue but i can’t confirm without testing (which i cant do at the moment). can you try and go to the pdf test page of the component and generate a basic url like www.google.com?


Does it generate?


Cheers,

Guilherme

Guilherme Pereira wrote:

Hi,


It shouldn’t have any issue but i can’t confirm without testing (which i cant do at the moment). can you try and go to the pdf test page of the component and generate a basic url like www.google.com?


Does it generate?


Cheers,

Guilherme

Okay, yes, that worked.  So I'm assuming this only works for urls that don't point towards an actual pdf or image?


It should work with any page unless there’s some kind of incompatibility with something on a page.


So from your test it seems that the component is now correctly configured. So i recommend you to try from your pc until you’re able to render the page and then try from the server.


Few reminders:

- the page must be accessible from the server. Check the url.

- the page should be anonymous

- start building the page from a blank theme and add your parts of the page piece by piece to try and understand what could be causing the incompatibility.


Hope this helps,

Guilherme