[Html2PdfConverter] Error: Problem generating PDF from HTML inconsistent
Forge component by Miguel 'Kelter' Antunes
Application Type
Traditional Web

We are having some inconsistent behavior of the Html2PdfConverter component in production.

When generating a PDF of a report it fails most of the times with the error "Problem generating PDF from HTML, URLs:".
No further information around the error is available. It's very inconsistent, if we do multiple attempts of the same report around 1 in 4 is successful.

We can't replicate the issue in test or dev. Updating the component & it's executables to the latest version didn't fix the issue.

Anyone has faced this issue before?

Kind regards,


Hello Dieter,

Can you check the logs or the output of the ones that would fail?

I'm trying to understand here if your error comes inconsistently (due to the parameters you are passing to it) it could possibly vary the output of the report you are trying to generate.

Can you present a screenshot of the error if possible so the community can assist further?

-Bojo

Hello,

attached image of the error. Which sadly doesn't really provide any information.

The error is inconsistently seeing that even when we pass the same parameters it can fail or succeed.
Because we send in the same data every time.


Hey,

I'm not 100% sure since I cannot see the entire stack trace but there's a word "Timeout" on the 2nd line upon GeneratePDF Action.

What you can do is try to see if your binaries are set up correctly.
Another is to check if you can generate (with less data).
If you can generate with less data, you might need to Optimize your query or the PDF itself so it would generate within the standard timeout.

Usually if it goes beyond 2mins it normally times out. If you cannot optimize it further and really expect this PDF to be large, then I would suggest to extend the Extension and the Module's timeout through (Factory Configuration).


Hope I could give you an idea on how to work around with concerns like this.

Let me know if you need further assistance.

-Bojo

Hello,

this timeout mention is just a parameter that you can pass on to the function.
Sadly I can't see the full stack trace either. This is the only part shown in OutSystems.

I do see that all calls are handles in around 1500ms, so it shouldn't be an issue of timeout.

Both failing and succeeding calls have the same timing.


Kind regards,

How many Front End Servers do you have running as of the moment?

Try to see if the successful ones are isolated in another server and the ones failing if it's specific to the other one.

I had a previous encounter where in the PDF would only generate on one of my FE servers (due to incorrect configuration).


Just a guess.

Hi, we are running into a similar issue. Did you find a solution for this ? 

Hi,

we determined that it indeed only worked on 1 FE server and both others gave errors.
Seeing we used the OutSystems cloud we couldn't directly change anything on server side so we decided to move to another component.



We switched to Ultimate PDF

https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf

Hi @Dieter Vennekens and @Silvia Apeldoorn

The issue described by Dieter, it is probably related to the IIS user permissions to access the HTMLtoPDF folder of executables on the servers. Given that it was only throwing errors on specific frontends and it was working on others.

I've already experienced that, if that so, you will need to grant access to the IIS_IUSRS to access the HTMLToPDF folder on the server.

Hi Joao, 

As far as I know we are running on only one front-end server. So that doesn't explain it in our case. 

We switched to UltimatePDF now and that seems to fix it.

Hi @João Carreiro ,

as mentioned, we were on a OutSystems Cloud instance so we don't have direct access to the servers themselves. To ensure that this problem doesn't arise again when we upscale or one of the servers gets changed for a new we decided that switching component was the safer & easier solution.

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