Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotativa, ABCPdf and EO.Pdf don't work in Azure WEBSITES and I don't want to upgrade to Azure "Cloudapp"

Given the circunstances (take them as a fact):

1) Rotativa PDF (https://github.com/webgio/Rotativa) uses an exe for creating PDFs, so it doesn't work on azure websites (no permission to execute that exe)

2) ABCPdf has the same problem

3) EO.Pdf has a similar problem ("uses Windows GDI but Windows GDI is not supported by Windows Azure WebSite", http://www.essentialobjects.com/doc/4/install/deploy.aspx)

4) I don't want to have an Azure Cloudapp (which would allow to me to use Rotativa or ABCPdf). I'm fine with my Azure Website (except for the previous problems).

Is there an alternative solution?
Is there any other library for creating PDFs from HTML that can run on an Azure Website (not CloudService nor VM)?




Update nov-2014:
I'm today using MvcRazorToPdf, it is great.

Controller's code:

return new PdfActionResult(palletReception, (writer, document) =>
{
    document.SetPageSize(new Rectangle(792f, 612f));
    document.NewPage();
})
{
    FileDownloadName = "foo.pdf"
};

View code:

A normal view with normal css.
Must be accepted by iText XMLWorker

Check this: http://demo.itextsupport.com/xmlworker/itextdoc/flatsite.html
and this: http://demo.itextsupport.com/xmlworker/
like image 811
sports Avatar asked Dec 06 '13 18:12

sports


1 Answers

You could leverage iTextSharp (http://sourceforge.net/projects/itextsharp/). Have used it very successfully in the past. It's even available as a nuget package these days - https://www.nuget.org/packages/itextsharp/.

like image 67
Simon W Avatar answered Sep 21 '22 23:09

Simon W