Articles in this section
Category / Section

Blank PDF is generated when converting HTTPS sites to PDF in Azure

3 mins read

When converting HTTPS sites, blank paged PDF may occur due to missing of the OPENSSL assemblies in Azure website. To convert HTTPS sites, the converter requires OPENSSL assemblies. By default, some Azure websites do not have the OPENSSL assemblies. So, these assemblies should be added to the website explicitly.

Refer to the following links for prerequisites and converting HTML to PDF in Azure.

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

https://www.syncfusion.com/kb/7543/

You can get the OPENSSL assemblies from the development machine, if HTTPS conversion is working on the development environment. Also, you can get the OPENSSL assemblies by installing the OPENSSL software. Please refer to the following links for more information,

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

You can also get the OPENSSL assemblies from below link,

OPENSSL binaries: https://www.syncfusion.com/downloads/support/directtrac/general/ze/OPENSSL43076462   

Steps to overcome the blank PDF issue on Azure website:

.NET Framework:

  1. Create a new folder in a project and copy the OPENSSL assemblies to that folder.
  2. Include that folder in a project and set copy to the output directory as “Copy always”.
  3. Get the path of the OPENSSL assemblies folder in C# and set it to the environment variable. Refer to the following code snippet.
    //Set Environment variable for OpenSSL assemblies folder 
    string SSLPath = Server.MapPath("~/OpenSSL"); 
    Environment.SetEnvironmentVariable("Path", SSLPath); 
    

 

Refer to the following screenshot for more information.

.NET Core:

  1. Copy the OPENSSL assemblies into the runtimes\win-x64\native folder. Refer below screenshot,
  2. Then set the copy to output directory as “Copy always” for all the files under runtimes\win-x64\native folder.
  3. There is no need to set environment variable for OPENSSL, the converter can access the OPENSSL assemblies from the runtimes\win-x64\native folder itself.
    Note:

    If we set environment variable for OPENSSL in .NET core, then the conversion may get failed in Azure.

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied