Hi All,
I'm having below error while trying to generate PDF.
An error occurred while generating the pdf for https://testserver.com/Module_name/ModulenameMainFlow.RequestTypeFormDetailInPDF.aspx?RequestHeaderId=3506&IDownloadedBy=2370: The remote server returned an error: (504) Gateway Timeout. at ssUltimatePDF.Actions.ActionPrintPDF_Proxy(HeContext heContext, String inParamURL, String inParamTemporaryFolder, String inParamProduct, String inParamRevision, RCViewportRecord inParamViewport, RCPaperRecord inParamPaper, Byte[]& outParamPDF) at ssUltimatePDF.Actions.ActionPrintToPDF_Advanced(HeContext heContext, String inParamURL, String inParamPaperSize, String inParamMarginSize, Byte[]& outParamPDF)
This is the test page that I built to play around with this component.
The URL enter in the input is stored in a local variable named as "URL". Below shows the logic I applied in Generate PDF button.
I noticed the error comes from PrintPDF_Proxy. Anyone has any idea on why it keep returning error code 504?
Greatly appreciate if anyone can help on this.
Cheers,Gwen.
Hello,
The error you having it's Timeout, unfortunately it's a common error on UltimatePDF,
The workaround to solve this problem is to increase the Timeout of your action!
Normally I encapsulate the action to generate the PDF and after in the flow I only increase the Timeout for this action.
Hi Gwen,
As suggested by Paulo it's generally resolved by increasing the timeout of your action which generates PDF, sometimes it can be of network issue as well.
Hope this helps!
Hi @Paulo Torres , @Venkatesh Sundarajan
Sorry to ask, where should I increase the timeout? I couldn't find the parameter to adjust the timeout of the action.
The action only have URL, PaperSize and MarginSize parameters.
Edit: The same component is used by other application of my company in the DEV environment is working fine. Unfortunately, when I applied the same into my application, it couldn't work. Like Venkatesh mention, it could be relate network issue as well. If this relate network issue, how is that possible that I able to generate the PDF in other application, while my application couldn't?
I noticed now you are speaking about Traditional, isn't it?
In this case it's different, you should use SetRequestTimeout action from HTTPRequestHandler.
Regards
Hi Paulo,
Yes, you are right.
My application type is Traditional Web. Also, I did tried to extract the ultimate action as new server action and drop it to my button flow. However, it dint show me "Server Request Timeout" as per your screenshot.
As per your suggestion, is this the correct way to increase the timeout?
Put the Timeout before!
Thanks for pointing out.
The PDF now managed to generate PDF, but it's not generating the correct output. It's showing default IIS page.
Perhaps, there's some blocking in my environment?
Which URL are you using on PrintToPDF_Advanced?
Hi Leonardo,
I'm using one of the page from my application as URL. URL: https://<server>/<module name>/MyRequest.aspx
After few rounds of testing, I noticed the above URL can be downloaded, although the exported content is not expected. When I used this URL "https://<server>/<module>/<myrequesttypename>DetailInPDF.aspx" to generate PDF, the browser will keep processing until it gets timeout. This URL is the main page that I wish to export as PDF.
Thank you.
Hi Gwen. How much time does it take until the timeout error happens?
OutSystems by default imposes a timeout of 100 seconds in traditional web. That should be enough for most PDFs, and if it's not enough then you should consider generating the PDF inside of a timer which has a default timeout of 20 minutes.
Moreover, when the OutSystems timeout is reached, the error logged is typically "Thread was being aborted" and not a 504 error.
You can try installing the Ultimate PDF Management component and downloading the execution log.
Regarding your question,Q: How much time does it take until the timeout error happens? A: Estimate took 6 minutes until the timeout error happened. After it timeout, showing 504 Gateway Timeout.
This is the error message logged in service center:
Hi Gwen. The Gateway Timeout seems to be happening in the browser, based on your screenshot. That means that you're not accessing the web server directly, but through a gateway, and this gateway is aborting the request after a certain period of time. I have seen this happen when using a CDN such as cloudflare or Akamai. However, the gateway configuration is out of scope of this component, so I can't help you with that.
I would start by checking why does the PDF take 6 minutes to process. If you can improve the performance of the PDF screen, you might be able to generate it before the gateway times out.
Otherwise, you will need to move the PDF generation to a background process such as a timer, and design a user experience to notify the user when the PDF generation is complete.
Hi @Leonardo Fernandes Im experiencing the same problem that the PDF generation times out.
Any idea how I could extend this time?
hey all,
hope you're doing well,
i have a question wich is: can i use the ultimatepdf, in mobile apps, cause it seems like im having problems with the URL, or smth, please help ?!!.