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.
125 stars 105 forks source link

Error from ControllerContext.GeneratePdf #50

Open RoyBradley opened 8 years ago

RoyBradley commented 8 years ago

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

RoyBradley commented 8 years ago

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