2 years ago

#59751

test-img

dawenwhen

Using PDFBox change PDF file to Bitmap, but meet some highlight part, so i got a poor conversion

Using PDFBox change PDF file to Bitmap, but meet some highlight part, so i got a poor conversion...

this is the wrong file page preview:

the wrong file page preview

and my code :

PDDocument document = PDDocument.load(assetManager.open("XXX.pdf"));
PDFRenderer renderer = new PDFRenderer(document);
pageImage = renderer.renderImage(0, 1, ImageType.ARGB);

// Save the render result to an image
String path = root.getAbsolutePath() + "/render.png";
File renderFile = new File(path);
FileOutputStream fileOut = new FileOutputStream(renderFile);
pageImage.compress(Bitmap.CompressFormat.PNG, 100, fileOut);
fileOut.close();

And then I got this result Image:

got this result Image, a poor conversion

can anybody help me? thanks a lot!

Here is the wrong file's link : https://github.com/yingbabywhen/yingbabywhen

java

android

pdfbox

0 Answers

Your Answer

Accepted video resources