0

We are using HTML Renderer to convert an HTML file to a PDF file in one of our ASP.NET MVC projects deployed on Azure. The web app generates the HTML page on the fly and converts it to PDF. However this fails on Azure.

My search on SO pointed out that PDFsharp GDI version does not work on Azure and to use the WPF version. But the WPF version doesn’t have a HTML to PDF method (we are using the PdfGenerator.GeneratePdf method).

What are my options here?

Does iTextSharp work on Azure?

Sampath D
  • 10,494
  • 1
  • 13
  • 8
  • 1
    Why don't you take the source code for PdfGenerator.GeneratePdf and compile it with the WPF build? – I liked the old Stack Overflow Feb 18 '16 at 08:52
  • 1
    Your question about iTextSharp on Azure should be a separate question, and is already answered [elsewhere on StackOverflow](http://stackoverflow.com/questions/4224771/creating-pdfs-in-itextsharp-with-azure) (the answer is yes). And in [this answer](http://stackoverflow.com/a/10078103/766786), the author claims _"We've used iTextSharp in Azure for over a year without any problems."_ – Amedee Van Gasse Feb 18 '16 at 09:52
  • Did you use the latest version of PDFsharp (1.50)? Did you provide private fonts? AFAIK you cannot access the system fonts under Azure, so private fonts must be supplied. – I liked the old Stack Overflow Feb 18 '16 at 10:15

2 Answers2

1

You can take the source code for PdfGenerator.GeneratePdf and compile it with the WPF build for use on Azure.

0

We ended up using iTextSharp on Azure without any issues. And it's free :)

Sampath D
  • 10,494
  • 1
  • 13
  • 8