Using Ghostscript.Net in an ASP.NET Azure Website

I am using Ghostscript.NET to convert a PDF page to jpg. This all works fine when I run it locally, but when I publish it to the Azure website, I get the error:

"This managed library runs under a 32-bit process and requires 32-bit Ghostscript to be installed on this machine! To download your own Ghostscript library, visit http://www.ghostscript.com/download/gsdnld.html "

Obviously I can't just install Ghostscript on the server that the Azure Website is running on, I don't have access to that. Is there a way that I can include the Ghostscript library in the publish profile, and read Ghostscript.NET?

Alternatively, is there any package that would allow me to convert a PDF page to a jpg thumbnail on an ASP.NET server without using Ghostscript at all? I also tried GhostScriptSharp and had no luck with that.

+3


source to share


2 answers


You can try installing your own ghostscript library on your local machine and get a gsdll32.dll (or gsdll64.dll if you are running in an x64 environment) that you can deploy to your server along with other dlls.



Take a look at this example how to tell Ghostscript.NET where to look for the original dhost dhost library: https://github.com/jhabjan/Ghostscript.NET/blob/master/Ghostscript.NET.Samples/Samples/CustomGsdllLocationSample.cs

+5


source


You have several options.

  • Submit your website as an Azure Cloud Service web role . This allows you to respond to the server you are creating and you can run setup programs (if they can be automated) to prepare the machine.

  • Divide this functionality into an Azure Cloud worker agent role (where you can do the same machine cooking) and respond to the Azure Queue . This way, your site remains the same.



Be careful, but Cloud services can get expensive if they just sit there doing nothing because they are still running in a virtual machine. You can get a scale of cloud services based on a queue with items or not.

0


source







All Articles