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

Issues with images

kazd916 opened this issue · comments

Hi there -

Thanks for creating this great library that we've been using for our project now. I am having one really annoying issue and I seem to not be able to find any answers online.

I have a model (that's being returned by a controller). This model has an image of type byte[]. My view is also being returned as a PdfActionResult from my controller and this image is part of the model that get's passed on to the view. When I was rendering this image as HTML it was working just fine but as soon I converted it to create a PDF output it keeps giving me exception(s). The exception message is this for now - "The document has no pages." but I am certain that the reason is something else and I don't know what that is because when I remove the image from the view, everything else gets rendered on the PDF just right.

K

While going through other issues closely, perhaps issue #45 might be similar to this one.

commented

This library doesn't support base64 images, but there is currently an open pull request that adds support (#55 )