You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/02/04 16:11:36 UTC
[jira] [Commented] (PDFBOX-988) pdmodel.font.PDSimpleFont hanging
on TrueType font (ubuntu)
[ https://issues.apache.org/jira/browse/PDFBOX-988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14305226#comment-14305226 ]
ASF subversion and git services commented on PDFBOX-988:
--------------------------------------------------------
Commit 1657272 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1657272 ]
PDFBOX-988, PDFBOX-1019, PDFBOX-2383: remove test with copyrighted document, fix typo in other test
> pdmodel.font.PDSimpleFont hanging on TrueType font (ubuntu)
> -----------------------------------------------------------
>
> Key: PDFBOX-988
> URL: https://issues.apache.org/jira/browse/PDFBOX-988
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.5.0
> Environment: Ubuntu 8.04 - Headless
> Reporter: Craig Stires
> Assignee: Andreas Lehmkühler
> Fix For: 2.0.0
>
> Attachments: F001u_3_7j.pdf, pdsimplefont_rebuildfont_fewglyphs.patch, pdsimplefont_rebuildfont_fewglyphs_40.patch
>
>
> When calling PDPage.convertToImage(imagetype,resolution) , I have found a case where the application hangs. No error messages, no exceptions, no CPU spike, no I/O. The error had to do with some strange corruption of the awtFont, by the time it reached the method PDSimpleFont.drawString. Some pretty deep digging turned up that if a font with too few glyphs is sent into PDSimpleFont.writeFont, it will enter Graphics2D.drawString ... ne'er to return.
> If a check is done to count the glyphs and if they fall below a certain threshold, then just re-instantiate the Font, then all goes well. Typical numbers range from 70 to 1000+, so I've gone with an arbitrary value of 40. All goes well, and I can't measure any difference in performance (except that my app will actually return from attempting this doc!).
> Attached is a sample PDF which can re-create the problem, and a patch which seems to solve it sensibly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org