Skip to main content

Why Are My Base64‑Encoded Images Failing to Render in the PDF Output?

Updated this week

Start by checking that your Base64 image is correctly embedded in the HTML. The correct format should be:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..." />

Make sure that:

  • The src attribute starts with data:image/png;base64, (or image/jpeg for JPEGs).

  • The Base64 string is complete, with no missing or extra characters.

  • There are no line breaks, spaces, or formatting issues in the string.

Did this answer your question?