[Html2PdfConverter] Error: File not Found

[Html2PdfConverter] Error: File not Found

Forge Component
Published on 2016-03-24 by Guilherme Pereira
40 votes
Published on 2016-03-24 by Guilherme Pereira
Hi all,

So the HTML2PDFConverter is used in the ElectronicCanvas application. There it work good, so I think my configuration is oké.

When I use the GenerateImage in a application of my own I get the following error:
/tmp/TEMPGLNUSYJTQOf02a7c7b09b94545bf74726064cd56a2.jpg (No such file or directory)
For the URL Parameter I use:
The URL value that is calculated from these functions is correct (I can copy past it in the browser and I just gives me the homepage) but the GenerateImage functions give an error.
Someone has any idea what’s the problem is?


Note: If I give a URL like "https://www.google.com/" this isn't giving any errors in my own application.
Hi Martijn,

Since the rendering of the PDF is done "on the side" you might want to check if there are exceptions occurring for that request on the Monitoring tab in ServiceCenter. Also, is the entry page requiring a login? The session is different when the extension calls it, so the request is not authenticated.

Kind Regads,
Hi Martijn,

Additionally if you say that on your browser you can access the url and render can you check if on the server browser it also can be accessed (could be a dns issue).

If instead of using a url you use the ip address for localhost (htpp:// does it work?

Hi Grazina,

Indeed the Homepage was not set that anonymous users where allloud to get in. I changed this.
Unfortunitly this didn't fixed the problem. I see this exception in the error list of ServiceCenter is that what you mean? At the extension sublink I see this actions:
Time of Log Action Duration Server  
22-07-2015 16:28:40
625 ms  eom_o Error
22-07-2015 16:28:39
0 ms  eom_o  
22-07-2015 16:28:39
0 ms  eom_o  
22-07-2015 16:28:38
1 ms  eom_o  
22-07-2015 16:28:38
4 ms  eom_o

Hi Guilherme,

But the ElectronicCanvas application (installed on the same envirmant) isn't having problems so that would also have problems if it is a DNS issue right? But how would I test the url in the server browser? I don't seem to find any input where that is possible (maybe a stupid question).
The isn't working. However when I did a typo I got the following result:

So it seems that the extension can find the page but something else is resulting in an error.
kind regards.

Hi Martijn,

The error you get when inputing a typo could be because with JBOSS the urls are case sensitive.

One thing you can try is debug your application up until the point you have the exact url.

Use linux wget to check if you server can reach the page: wget -S -O - http://xxxxx.

Can you access the page directly from the server?


Hi Guilherme,

Yes the server can reach the page.
On the server we could look better at the Java stacktrace and it looks like the writing itself already fails.
Hi Martijn,

If the server can access (excludes network limitations) and ElectronicCanvas can export (excludes component problems) there's not much more I can remember.

One question how many front ends do you have? More than one? 

if so have you activated the Farm Configuration on the administration page?
Yes we have 2 frontend servers on the development environment.
And the checkbox is checked on the administration page.

Hi Martijn,

Very weird. Have you checked connectivity on both front ends?

Can you share your error log and general log with the DebugMessages activated?

Hi Guilherme,

Thanks for helping.
Here I have the errors:

There are no logs in the general log related to the raised error.
What do you mean with DebugMessages activated. The option is enabled in the administration page of the component.

Kind regards,
Martijn Habraken
Hi Martijn,

Following our conversation let me post here the findings so it may benefit someone who faces a similar issue.

So after analysing the configuration and guarantee that there was no connection issues between the server and the page it was trying to generate the next step was to execute the library behind the component directly on the server.

This is a step that will ensure that the issue was not in the extension itself and it wasn't (it was pretty clear that because other applications can generate pdf/images without issues).

After some troubleshooting we came to a conclusion that the network error was because of SILK (I don't know the exact cause but some script on it is generating an error and preventing the wkhtml from executing).

The recommendation was then to create a new empty theme not based on SILK and create a new webflow that will use this blank theme. We tested this and it was working correctly.

I continued the troubleshoot later and when executing the component I found out that it has an optional param to ignore these network errors and I tested this on my personal area and it seems to be working on a SILKUI based page as well.

This was the output of the component:

Error: Failed loading page http://xxxxxxxx/TestSILKPDF/Entity1s.aspx (sometimes it will work just to ignore this error with --load-error-handling ignore)
Warning: A finished ResourceObject received a loading progress signal. This might be an indication of an iframe taking too long to load.
Warning: Received createRequest signal on a disposed ResourceObject's NetworkAccessManager. This might be an indication of an iframe taking too long to load.
Exit with code 1, due to unknown error.
And by using the suggested parameter " --load-error-handling ignore " it is able to generate pdf/image for that page.

Most of the difficulties people are finding when troubleshooting the component is related with the overly generic error message. I'll try to find a way to included the STDOUT on the exception message so it becomes easier to understand and troubleshoot these issues.

Hope this helps