danfickle / danfickle/openhtmltopdf

Base64 Code not rendering for huge Image

Open
#861 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

Hi,
I´m using the function to create a Base64 String:

`public static String convertToBase64(File file) throws IOException {

LOGGER.info("START convertToBase64");

InputStream finput = new FileInputStream(file);
byte[] imageBytes = new byte[(int) file.length()];
finput.read(imageBytes, 0, imageBytes.length);
finput.close();

String result = Base64.encodeBase64String(imageBytes);

LOGGER.info("END convertToBase64");
return result;
}`

If I have images which a bigger (4 MB) than OpenHTMLtoPDF is not rendering those images anymore.
For images which are not so big (1 MB) it´s working fine.
In the HTML page is rendering fine.

Any ideas?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.