I have been using your MVC html to pdf for several years without issues. I recently (past few days) have gotten this message when trying to render PDF documents from an MVC view:
Format error: not a PDF of corrupted.
I know it's a very generic error. The view renders fine in the browser if not pdf. The view is html and css only, no javascript or anything.
Controller code:
Code: C#
[EO.Pdf.Mvc.RenderAsPDF]
public ActionResult ActivityPDF(int id)
{
var path = VirtualPathUtility.ToAbsolute("~/Content/");
EO.Pdf.HtmlToPdf.Options.BaseUrl = new Uri(Request.Url, path).AbsoluteUri;
EO.Pdf.HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(8.5f, 11f);
EO.Pdf.HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0.5f, 0.5f, 7.5f, 10f);
MVCToPDF.ResultFileName = "CCC_Checkin.pdf";
EO.Pdf.HtmlToPdf.Options.MinLoadWaitTime = 2 * 1000;
var a = _volunteerService.GetVolunteerProjectActivity(id);
return View(Mapper.Map<VolunteerProjectActivityViewModel>(a));
}
My project is very extensive, the PDF rendering is a small part but very important. The PDFs were working recently, so I am wondering where I can look to troubleshoot this.
I have tried rending a very simple view with just Hello World - still corrupted. I have tried multiple pdf readers to view the file (Adobe and Foxit) as well as multiple computers.
Any help would be greatly appreciated.