[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803962#comment-17803962 ] Andreas Lehmkühler commented on PDFBOX-5721: The internal cmap mapping from the font is used due to the "missing" toUnicode mapping > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803955#comment-17803955 ] Andreas Lehmkühler commented on PDFBOX-5721: [~tilman] thanks for the fix, looks good to me. I don't see any fix for the other issue but fortunately it isn't related to the described rendering issue, so that I'd set this to resolved. > 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 >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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803949#comment-17803949 ] ASF subversion and git services commented on PDFBOX-5721: - Commit 1915114 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1915114 ] PDFBOX-5721: ignore EOF if it is before just data > 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 >Affects Versions: 2.0.30 >Reporter: liu >Priority: Major > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803947#comment-17803947 ] ASF subversion and git services commented on PDFBOX-5721: - Commit 1915112 from Tilman Hausherr in branch 'pdfbox/branches/3.0' [ https://svn.apache.org/r1915112 ] PDFBOX-5721: ignore EOF if it is before just data > 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 >Affects Versions: 2.0.30 >Reporter: liu >Priority: Major > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803948#comment-17803948 ] ASF subversion and git services commented on PDFBOX-5721: - Commit 1915113 from Tilman Hausherr in branch 'pdfbox/branches/2.0' [ https://svn.apache.org/r1915113 ] PDFBOX-5721: ignore EOF if it is before just data > 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 >Affects Versions: 2.0.30 >Reporter: liu >Priority: Major > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803946#comment-17803946 ] Tilman Hausherr commented on PDFBOX-5721: - The font is broken, here's the left pane of DTL OTMaster, the hmtx and post tables exist but have no content. The right pane exists but it seems to be a subset, but isn't named like a subset. Surprisingly, the rendering problem vanishes if I catch the EOF in the post table. (the EOF is at the beginning, so I'd say it's graceful) !image-2024-01-07-13-19-32-380.png! > 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 >Affects Versions: 2.0.30 >Reporter: liu >Priority: Major > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803945#comment-17803945 ] Andreas Lehmkühler commented on PDFBOX-5721: The first exception occurs due to a malformed codespacerange within the font "DroidSansFallbackFull" using the name "KSPF1". The end value of the codespace range consist of 5 bytes which is wrong {code} 1 begincodespacerange <> {code} > 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 >Affects Versions: 2.0.30 >Reporter: liu >Priority: Major > 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(600); > } > 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: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org
[jira] [Commented] (PDFBOX-5721) The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.
[ https://issues.apache.org/jira/browse/PDFBOX-5721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17803937#comment-17803937 ] Andreas Lehmkühler commented on PDFBOX-5721: There are two exceptions while opening the mentioned pdf using PDFDebugger {code} Error [PDFont] Could not read ToUnicode CMap in font DroidSansFallbackFull java.io.IOException: java.lang.IllegalArgumentException: The start and the end values must not have different lengths. at org.apache.fontbox.cmap.CMapParser.parseBegincodespacerange(CMapParser.java:268) at org.apache.fontbox.cmap.CMapParser.parse(CMapParser.java:110) at org.apache.pdfbox.pdmodel.font.CMapManager.parseCMap(CMapManager.java:72) at org.apache.pdfbox.pdmodel.font.PDFont.readCMap(PDFont.java:220) at org.apache.pdfbox.pdmodel.font.PDFont.loadUnicodeCmap(PDFont.java:144) at org.apache.pdfbox.pdmodel.font.PDFont.(PDFont.java:113) at org.apache.pdfbox.pdmodel.font.PDType0Font.(PDType0Font.java:73) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:96) at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:170) at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:72) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:892) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:530) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:505) at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:152) at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:285) at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:330) at org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:532) at org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:1) at javax.swing.SwingWorker$1.call(SwingWorker.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at javax.swing.SwingWorker.run(SwingWorker.java:334) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.IllegalArgumentException: The start and the end values must not have different lengths. at org.apache.fontbox.cmap.CodespaceRange.(CodespaceRange.java:50) at org.apache.fontbox.cmap.CMapParser.parseBegincodespacerange(CMapParser.java:264) ... 23 more {code} and {code} Warning [PDCIDFontType2] Could not read embedded OTF for font DroidSansFallbackFull java.io.EOFException at org.apache.fontbox.ttf.TTFDataStream.readUnsignedShort(TTFDataStream.java:154) at org.apache.fontbox.ttf.PostScriptTable.read(PostScriptTable.java:79) at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:365) at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:165) at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:144) at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:66) at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.(PDCIDFontType2.java:123) at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.(PDCIDFontType2.java:72) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createDescendantFont(PDFontFactory.java:138) at org.apache.pdfbox.pdmodel.font.PDType0Font.(PDType0Font.java:97) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:96) at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:170) at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:72) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:892) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:530) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:505) at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:152) at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:285) at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:330) at org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:532) at org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:1) at javax.swing.SwingWorker$1.call(SwingWorker.java:295) at java.util.concurrent.FutureTask.run(Fu