1

I'm trying to use Syncfusion to convert HTML to PDF on Windows Azure.

It is working fine on the development machine. However on Windows Azure it does not work with HTTPS protocol. It will only work with HTTP.

Syncfusion's troubleshooting website suggests the following solution:

Reason When OpenSSL package is not installed in the machine. Solution For converting HTTPS sites, it requires OPENSSL libraries to be installed in the machine. The OPENSSL library can be installed by downloading its setup from the below link,

OpenSSL

Instead, the required assemblies can added in the Windows system folder (for 64 bit machine, it should be place in

$SystemDrive\Windows\SysWOW64 and for 32 bit machine, it should be place in

$SystemDrive\Windows\System32),

libeay32.dll
libssl32.dll
ssleay32.dll

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

Is it possible to implement this with App Services? If so how would I go about it?

Mark3308
  • 1,298
  • 11
  • 22
  • See [this answer](https://stackoverflow.com/a/39397997/5209435). There is also an HTTPS only toggle under the Custom Domains blade of your app service that you may want to enable once you've got the call to the external API working. – Matt Stannett Jun 02 '19 at 10:00

2 Answers2

1

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. We could not place the assemblies in system drive on Azure App service environment. Refer below steps to place the OPENSSL assemblies in Azure for converting HTTPS sites to PDF.

  1. Create a new folder in a project and copy the OPENSSL assemblies to that folder.

    • libeay32.dll

    • libssl32.dll

    • ssleay32.dll

  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 below link for more information about adding OPENSSL assemblies in Azure.

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

Note: I work for Syncfusion.

Prakash V
  • 36
  • 2
  • We have a very similar problem with the approach of the Bridge app: is this workaround working also for bridging? how do you deal with multiple architectures like x64, x32, ARM and ARM64? – Cristiano Ghersi Oct 18 '19 at 15:28
0

Due to some limits about Azure Web App sandbox, I am sure you can not directly add these required assemblies in the Windows system folder.

Although I never used Syncfusion, per my experience, I think you can try to add these required dll libraries in the same folder of the Syncfusion's. Because the dll load path generally be the system foloder or the same path from caller.

Other doubts by me, Azure default supports SSL, I don't think you need to install OpenSSL manually. May you just need to change your code to use an exisiting SSL certificate to support HTTPs for Syncfusion, as the offical document Use an SSL certificate in your application code in Azure App Service said.

All above as reference only based on my thinking. Hope it helps.

Peter Pan
  • 23,476
  • 4
  • 25
  • 43