HTMLConverter Shows Blank Page When on Production Server

During testing, the HTML Converter flawlessly converts the current ASPX page into a PDF version. However, when I upload all my files to the server and run from outside the network, it only shows a blank page.

When I log on to the server and test with internal browser, it works fine. But when I use an outside browser, it all shows up blank.

How can I get the PDF from the live site?

        Dim htmlconverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
        Dim settings As New WebKitConverterSettings
        settings.WebKitPath = Server.MapPath("/QtBinaries")
        settings.AdditionalDelay = 4000
        settings.PdfPageSize = PdfPageSize.Letter
        settings.MediaType = MediaType.Print
        settings.WebKitViewPort = New Drawing.Size(800, 0)

        htmlconverter.ConverterSettings = settings
        Dim urltoconvert As String = HttpContext.Current.Request.Url.AbsoluteUri
        Dim document As PdfDocument = htmlconverter.Convert(urltoconvert)
        document.Save("Sample.pdf", Response, HttpReadType.Open)

        document.Close()


3 Replies

PV Prakash Viswanathan Syncfusion Team January 28, 2022 10:42 AM UTC

Hi Chris,


Thank you for contacting Syncfusion support.


The reported blank page issue may occurs due to missing of OPENSSL assemblies in the server. HTML to PDF converter with WebKit rendering engine requires OPENSSL assemblies for converting HTTPS URL to PDF. So, kindly ensure the server contains OPENSSL assemblies. Please refer below link for more information about OPENSSL,

UG: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl

KB: https://www.syncfusion.com/kb/8821/blank-pdf-is-generated-when-converting-https-sites-to-pdf-in-azure


If you have permission to install OPENSSL, you can copy the files from your development environment to server. We need to copy the below files from development environment to server machine.

  • libeay32.dll
  • libssl32.dll
  • ssleay32.dll


Kindly refer trouble shooting section for more information,

https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#troubleshooting


Regards,
Prakash V



CH Chris January 28, 2022 04:57 PM UTC

Thanks for the quick response. Everything works fine if I give it an outside web address (https://www.google.com) but it doesn't work if I give it an address from within IIS (https://mywebsite/report.aspx)



GK Gowthamraj Kumar Syncfusion Team January 31, 2022 01:15 PM UTC

Hi Chris, 

The reported blank page issue may occurs when the webpage (HTML) is not available or accessible in server, it will return blank. If the webpage is authenticated, we can convert the authenticated web page to PDF using cookies in HTML to PDF converter. We suspect that, if the cookies values are not authenticated properly in that webpage URL and return blank page or login page. Please check the HTML URL is rendered properly in Chrome browser’s print preview in server machine.  


We request you to share the simple sample with input HTML webpage, output document, complete code snippet, server environmental details (OS, Bit version, platforms, culture settings), replication sample with steps to check the issue on our end. So, that it will be helpful for us to analyze and assist you further on this.    

Regards, 
Gowthamraj K 


Loader.
Up arrow icon