danfickle / danfickle/openhtmltopdf
Rendering PDF document using `img` tag with Base64 content
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 423
- PR merge metrics
- No merged PRs in 30d
Description
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:
```html
```
However, when I do the same thing with a PDF (following the guidance in [this issue](https://github.com/danfickle/openhtmltopdf/issues/344#issuecomment-508524237)), the PDF can't be resolved.
This is the HTML that I used:
```html
```
And the error I get is:
> com.openhtmltopdf.load WARNING:: Unrecognized image format for: data:@file/pdf;base64,{base64 encoded data here} => java.io.IOException:: Unrecognized Image format
Is this expected behavior, or is this a bug with how PDFs are handled via the `img` tag?
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.