You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Ben Root (JIRA)" <ji...@apache.org> on 2012/05/30 22:36:23 UTC

[jira] [Commented] (PDFBOX-62) Incorrect (zero) character widths returned in some docs

    [ https://issues.apache.org/jira/browse/PDFBOX-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286014#comment-13286014 ] 

Ben Root commented on PDFBOX-62:
--------------------------------

Hello,

I have just downloaded pdfbox-app-1.7.0.jar and began to use it in my application. I encountered a similar zero character width problem. I loaded the file that Tamir attached (5542.pdf) using the following code snippet and found that the printed document had a number of zero width characters which appear as points where multiple characters overwrite each other.

Begin Code

        final PDDocument loaded = PDDocument.load(new File("/Users/ben/Desktop/5542.pdf"));
        loaded.silentPrint();

End Code

Thanks for any light you can shed on this!

Best,
Ben
                
> Incorrect (zero) character widths returned in some docs
> -------------------------------------------------------
>
>                 Key: PDFBOX-62
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-62
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>         Attachments: 5542.pdf
>
>
> [imported from SourceForge]
> http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1216674
> Originally submitted by tamirhassan on 2005-06-07 13:42.
> For certain PDF documents (such as the one attached) 
> the character/string widths (as obtained e.g. by the 
> PDFont.getStringWidth method) are not returned 
> correctly, i.e. they appear to be correct for punctuation 
> characters but are zero for alphanumeric characters.  
> It seems as if these alphanumeric characters are NOT 
> within PDFont.firstChar and PDFont.lastChar in the 
> Type 1 font.  The method therefore attempts to obtain 
> the font widths from the AFM (font metric) file, but fails 
> (silently) with a 'resource is null' logline message.
> (Note that this problem doesn't seem to occur with Type 
> 1 fonts in other documents.)
> A more detailed discussion regarding this issue can be 
> found in this link:
> http://sourceforge.net/forum/forum.php?
> thread_id=1260349&forum_id=267205
> Thanks in advance for any help that can be obtained,
> Tam

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira