-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering PDF document using img
tag with Base64 content
#829
Comments
hi @jfreedman-eagent as far as I remember and looking at the source of the error ( https://github.com/danfickle/openhtmltopdf/blob/open-dev-v1/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxImage.java#L33 ) , the base64 images are handled through ImageIO. So we may need to add a special case for data:file/pdf;base64 encoded data. |
Thanks for responding! Is this something that would be worth creating a PR for? If so, I can take a stab at implementing it |
Yes, as it's quite a coherent request, if linking a img via the file protocol work, it should also for data: base64 :) |
hi, @jfreedman-eagent |
Gah, sorry @Dunemaster. I haven't started working on this, so feel free to go for it. I meant to pick it up, but other stuff came up since then 😓 |
I want to display PDFs and images inline with the PDF I'm generating, but I only have the raw data for each file (and their associated MIME type). For images, I can do this with:
However, when I do the same thing with a PDF (following the guidance in this issue), the PDF can't be resolved.
This is the HTML that I used:
And the error I get is:
Is this expected behavior, or is this a bug with how PDFs are handled via the
img
tag?Thanks!
The text was updated successfully, but these errors were encountered: