4

I am using HiQPdf DLL to convert my HTML into PDF. It works on all server but when i deployed this to Azure ,it throws an error. Below is the error:-

"HiQPdf.HtmlToImage HTML layout error"

Thanks for your help in Advance.

Aldwoni
  • 1,168
  • 10
  • 24
Parveen
  • 652
  • 1
  • 9
  • 27

1 Answers1

1

Please check the HiQPdf HTML to PDF Converter for .NET FAQ regarding the Azure deployments. Below I copied the information from that page.

Basically you can use the HiQPdf library in Windows Azure Cloud Services and Virtual Machines but not in Web Sites because the Web Sites run in a restricted sandbox. Using Visual Studio you can easily transform an existing ASP.NET 4.0 or MVC application into a Web Role by adding a cloud service project to the solution containing your project. For this, open your solution, right click on the ASP.NET project and select the 'Add Windows Azure Cloud Service Project' option from menu. Right click on the added cloud service project and select the 'Package' option to produce a package and a configuration file you can deploy as an Azure Cloud Service.

HiQPdf
  • 142
  • 5
  • 4
    It's not a solution. Why should I convert my solution from website to Web Role. – Ihtsham Minhas Oct 11 '16 at 12:22
  • 2
    You should convert to a web role if you want to quickly solve the problem. Otherwise, if it's not an option for you, then you would have to implement a separate cloud service to call from your website. The library works directly only in Azure cloud services as explained in that answer. If you cannot convert to a Azure Web Role that doesn't mean it's not a possible solution in general. – HiQPdf Oct 13 '16 at 09:09
  • @HiQPdf Can you provide some links to how I could setup a new Azure Cloud Service to handle PDF generation using HiQPdf? – Kevin Dec 01 '17 at 19:21
  • Has anyone got to solve this issue with the provided answer? I tried create a new Web Job (trigger type) and moved all HiQPdf related code over there. From my web app, I am calling this Web Job (using HttpClient - POST method). However, I am still getting the same error saying "Invalid viewport size". This is the same error I used to get while invoking HiQPdf methods directly from my web app. That means, this didn't make any difference at my level. Can anyone please share his/ her experience with this solution? It would be very much appreciated. – Nirman Feb 19 '19 at 11:28