[
https://issues.apache.org/jira/browse/PDFBOX-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Juraj Lonc updated PDFBOX-1408:
-------------------------------
Attachment: PDFBOX-1408_PDFStreamEngine.patch
This is the "fast & ugly" fix.
It's just to show what I mean so the "pretty version" of this fix is up to you
:)
Actually I am not sure PDFStreamEngine.java is the best place to put this fix
in. Maybe the better place would be PDSimpleFont.getFontWidth
> Width of space character is calculated wrong
> --------------------------------------------
>
> Key: PDFBOX-1408
> URL: https://issues.apache.org/jira/browse/PDFBOX-1408
> Project: PDFBox
> Issue Type: Bug
> Reporter: Juraj Lonc
> Attachments: makcene-export.pdf, PDFBOX-1408_PDFStreamEngine.patch
>
>
> PDFStreamEngine calculates width of space (line 357):
> spaceWidthText = (font.getFontWidth( SPACE_BYTES, 0, 1
> )*glyphSpaceToTextSpaceFactor);
> In some cases the result is 0.
> Problem is that getFontWidth requires code number of " ".
> If there is "ToUnicode" mapping for that font that it is necessary to lookup
> CMap for code number and NOT to use 0x20 (space) as it is in souce code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira