[
https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr resolved PDFBOX-5721.
-------------------------------------
Assignee: Tilman Hausherr
Resolution: Fixed
Surprisingly, even text extraction works properly, despite the bad syntax.
[~lehmi] thanks for the ping and the feedback.
> The embedded font DroidSansFallbackFull reports an error when parsing, and
> finally uses lastResortFont, resulting in garbled fonts.
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-5721
> URL: https://issues.apache.org/jira/browse/PDFBOX-5721
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.30
> Reporter: liu
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
> Attachments: CMISG Mutual NDA_Enepath_09Nov23_signed6.pdf,
> droid-bad.ttf, image-2024-01-07-13-19-32-380.png, image0.jpg
>
>
> demo:
> public static void main(String[] args) throws IOException,
> InterruptedException {
> File file = new File("C:\\Users\\LYCIT\\Downloads\\CMISG Mutual
> NDA_Enepath_09Nov23_signed6.pdf");
> final PDDocument load = PDDocument.load(file,
> MemoryUsageSetting.setupTempFileOnly()
> .setTempDir(new File("D:\\fcs\\test")));
> PDFRenderer renderer = new PDFRenderer(load);
> renderer.setSubsamplingAllowed(true);
> int pageIndex = 0;
> float scale = 2f;
> BufferedImage bufferedImage = renderer.renderImage(pageIndex,
> scale, ImageType.RGB);
> FileOutputStream fos = null;
> try {
> fos = new FileOutputStream(new
> File("D:\\fcs\\test/test6/image" + pageIndex + ".jpg"));
> ImageIO.write(bufferedImage, "jpg", fos);
> } finally {
> if (fos != null) {
> fos.close();
> }
> }
> Thread.sleep(6000000);
> }
> pdf:CMISG Mutual NDA_Enepath_09Nov23_signed6.pdf
> garbled fonts:image0.jpg
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]