Load HTML error or navigation timeout

8.9k views Asked by At

I am trying to convert a URL to pdf using evoPDF dll. This runs fine when I execute it on my local machine but fails every time when It is hosted on IIS server. The error is given below.

Load HTML error or navigation timeout.

Any suggestion will be highly appreciated about what might be the possible reason for this failure.

3

There are 3 answers

1
Glen Little On

Be aware also, that if you are using ASP.NET MVC and are setting the HttpCookies, then the Controller that is hosting the PdfConverter must be marked with:

  [SessionState(SessionStateBehavior.ReadOnly)]
0
NickD On

use netstat -a -n | find "SYN"

pretty sure you have an firewall problem :-) I had the same issue, my website referenced google analytics which was blocked by our fw.

As well, set the navigate and render timeout to something like 10 seconds. The defaults are way too high.

I use html-to-pdf but it seems to be a whitelabel solution which is used under many different names.

1
EvoPdf On

You should first check that the HTML page you convert is accessible in a browser on the server where you run the conversion. You can find more details in troubleshooting page in online documentation on EVO website. Here is a copy of the relevant information:

The conversion fails with 'Navigation interrupted', 'The remote host name was not found', 'The remote server refused the connection' or 'Unknown network error' error message

These error messages indicate a network problem when the converter tries to access the HTML page to convert on the server where the conversion runs. The first thing you can try is to check whether the HTML page you convert can be accessed in a browser on that server. It is important to login on that server and to access the HTML page from there because it is not uncommon that a page hosted on a server is accessible from outside the server but not from server itself, due to various security restrictions. If the HTML page is not accessible in a browser on server then you should work with your network administrator to make it accessible.

The 'Navigation interrupted' can also occur when the HTML page takes too long to be loaded. In this case you can simply increase the HtmlToPdfConverter. NavigationTimeout property value.

If the HTML page is accessible but you still get a network error in converter then you should check if the browser on server uses any proxy settings to access the HTML page. If you find such proxy settings then you should set the same options in converter as explained in Proxy Options topic. If the HTML page requires authentication then you should resolve it based on the information from Authentication Handling topic.

If the cause of the issue is not any of the possible causes mentioned above, then you should search the issue in the identity of the user running the converter being different from the user running the browser. When you login on the server you run the browser in the context of the logged in user which usually is an Administrator. Many of the network mechanisms used in HTML page access can be based on user identity and network credentials. For example Integrated Windows Authentication or Proxy Authentication can be based on the credentials of the user running the converter. The converter is configured by default to use the credentials of the user running the converter, but if you run the converter in ASP.NET then the user running the converter is the IIS pool identity, which most probably is not an Administrator. To run the converter in the same context as the browser you have to either set the IIS pool identity to an Administrator or run the conversion in a Windows Forms desktop application on that server.

When you using the converter in ASP.NET the issue might be caused by impersonation you have set in your ASP.NET application. When you use impersonation you would expect the converter to run in the context of the impersonated user but this is not true unless you set the appropriate Impersonation Options in converter.