We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Html To PDF is not working when I upload the project on a server and use the ip address of that server.

Hi SyncFusion Team,

First of all, thanks for these great controls which you provide.

I have a issue in HtmlToPdf control, when I publish my asp mvc project to a server and call my website using ip address ex: 82.212.54.99/MyWebsite from any pc;  HtmlToPdf control doesn't work and takes too much time, but from the same server when I use localhost/MyWebsite it's working.

moreover styles and images doesn't loaded in the pdf when using ip address (in case it downloaded the file after 3 minutes for example)

Waiting you respose :) 

Thanks

1 Reply

GK Gowthamraj Kumar Syncfusion Team September 3, 2019 12:07 PM UTC

Hi Muath, 

Thank you for using Syncfusion products. 

Our WebKit HTML converter internally creating temporary files in temporary folder for converting HTML to PDF. So, it requires read/write and execute permission for the temp folder. When hosting the application to IIS, our converter makes use of system temporary folder (By default, C://Windows//Temp). So, please make sure this path has required permission for the respective user group (IIS_IUSRS). If you are hosting the application in IIS, please try to add IIS_IUSRS user group and provide full access permission to the temp folder.  

Refer below UG link for more information. 

For resources loading issue

We have suspect that the published server URL is in HTTPS format, so that the baseURL was not able to find the resources (such as images, scripts, styles) of the HTML file. While accessing the HTTPS resources, WebKit HTML converter requires OPENSSL libraries to be installed in the machine. You can copy the OPENSSL libraries from development machine and paste it into server machine and then try the conversion in your project and let us know the result. Please ensured that the website url in browser for all the resources are loaded properly in server machine.   

Refer below UG links for more information, 

If the base URL is not HTTPS, then kindly try the additional delay to the converter for loading the external resources (styles, scripts, images etc.,). Can you please try the conversion with additional delay and let us know the result. Please refer below code snippet for set the Additional Delay property to converter settings, 

//Set additional delay; units in milliseconds 
webkitConverterSettings.AdditionalDelay = 2000; 

Please refer the below links for more information about Additional delay, 

Please let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K 


Loader.
Live Chat Icon For mobile
Up arrow icon