danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 359 forks source link

base64 images not loaded #975

Open fabioportieri opened 4 months ago

fabioportieri commented 4 months ago

Hello i'm experiencing trouble when trying to render into pdf any base64 image i tried several, even in the online sandbox page (https://sandbox.openhtmltopdf.com/), posting the code:

<html>
<head>
<style>

</style>
</head>
<body dir="auto">

<div style="text-align: center;">
  <img alt="" src="data:image/png;base64,iVBORw0KGgoAAA
ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4
//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU
5ErkJggg==" style="width:36pt;height:36pt" ></img>
</div>

<div style="text-align:center;font-size: 90px;color:orange;">
  Hello World!
</div>

</body>
</html>

nothing get rendered, here the logs:

SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Loaded document in ~0ms
TIME: parse stylesheets 0ms
media = print
Matcher created with 160 selectors
Hit key(font-metrics:handwriting:400:normal) from cache.
Hit key(font-metrics:arabic:400:normal) from cache.
Hit key(font-metrics:deja-sans:400:normal) from cache.
Hit key(font-metrics:cjk:400:normal) from cache.
URI resolver rejected loading image at (data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==)
URI resolver rejected loading image at (data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==)
Using fast-mode renderer. Prepare to fly.

Isn't that supposed to work?

p.s. i read from another issue that it isn't supposed to work on the sandbox, problem is is not working on our java app neither, is there any additional configuration to do ?

Thank you for any assistance