I have a screen on a reactive app, that I want to convert into PDF, and send the PDF by email.Since the generated PDF is quite large (over 100 pages) this runs on the background.
However, no matter what method I use, I always end up getting the same error/issue on the UltimatePDF_Service PrintPFD service action.
The log is as follows:
Both the PrintToPDF action, or using the ScreenToPDF_OnInitialize with preview set to false result on this timeout.
However, setting the preview to True loads the screen very fast (under 2 seconds) with all the data correctly rendered.
This shows me that the issue is not on retrieving the data from the server, but on the conversion of the result html to PDF.
Doing some quick research, this seems related to a known issue (https://github.com/hardkoded/puppeteer-sharp/issues/2718) which can be fixed by increasing the timeout with ProtocolTimeout (https://www.puppeteersharp.com/api/PuppeteerSharp.LaunchOptions.html#PuppeteerSharp_LaunchOptions_ProtocolTimeout). But manually setting the modules timeout parameters doesn't help on this regard. And since it's a reactive application I also can't use the UseTimeout.
If anyone has any ideas on how to work around this issue, or point me in the right direction or alternative method to preview the PDF, I would appreciate it very much.
Hi Hugo. This timeout should be fixed on version 15.0.0.
Thank you for your answer @Leonardo Fernandes
Can confirm that having updated today to 15.0.0 the timeout is not happening, and the pdf is correctly generated.
Hi @Hugo Seixas ,
You need to add server action to wait the flow so that it will wait until the download complete because default timeout is 180 seconds .
Thanks
Murugan S S
Thanks for trying to help, but in my case the timeout is happening inside the extension function:
Adding a server wait will not help at all.
Hello,
Have you tried using this server action prior to generating the pdf?
It helped in my use case.
Best regards