You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2015/06/27 12:23:04 UTC
[jira] [Commented] (PDFBOX-2843) widthOfSpace() appears wrong in
TextPosition
[ https://issues.apache.org/jira/browse/PDFBOX-2843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14604096#comment-14604096 ]
Andreas Lehmkühler commented on PDFBOX-2843:
--------------------------------------------
The width of a character depends on the used font. Please, attach a sample pdf demonstrating the described effect.
BTW, you should update to 1.8.9
> widthOfSpace() appears wrong in TextPosition
> --------------------------------------------
>
> Key: PDFBOX-2843
> URL: https://issues.apache.org/jira/browse/PDFBOX-2843
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 2.0.0
> Environment: JDK 8 on Windows 7
> Reporter: Richard Wolfgram
>
> When using the following override method of PDFTextStripper I am getting a large difference in values for TextPosition.getWidthOfSpace() between version 1.8.6 and pdfbox-2.0.0-20150611.100833-1423
> @Override
> protected void processTextPosition(TextPosition textPos)
> {
> float spaceWidth = textPos.getWidthOfSpace();
> float width = textPos.getWidth();
> System.out.println(textPos.getCharacter() + " - Width of Space=" + spaceWidth + " - width=" + width);
> builder.append(textPos.getCharacter());
> }
> In 1.8.6 average character width is around 5 and space width is around 2.5
> In 2.0 average character width is around 5 and space width is around 27
--
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