andyhutch77 / MvcRazorToPdf

Create pdf documents within an asp .net mvc project by generating your views as normal but returning a PdfActionResult. This converts regular produced razor/html to pdf documents in the browser using the iTextXmlWorker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error from ControllerContext.GeneratePdf

RoyBradley opened this issue · comments

I get the following error when I call GeneratePdf:
RuntimeWorkerException was unhandled by user code
An exception of type 'iTextSharp.tool.xml.exceptions.RuntimeWorkerException' occurred in itextsharp.xmlworker.dll but was not handled in user code
Additional information: Invalid nested tag head found, expected closing tag link.

This is the call:
byte[] pdfOutput = ControllerContext.GeneratePdf(model, "CreatePDF", (writer, document) => {
document.SetPageSize(PageSize.LETTER);
document.NewPage();
});

Roy W Bradley

I've attached the view
http://localhost:57108/Views/PDF/CreatePDF.cshtml

Updated Information
iTextSharp Version 5.5.9
itextsharp.xmlworker version 5.5.9
MvcRazorToPdf Version 1.0.2