You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Shengwen Yang <ya...@gmail.com> on 2009/04/03 11:15:56 UTC
Re: [jira] Commented: (PDFBOX-450) PDFTextStripper CAN NOT extract
correct font information for some early produced PDF documents
Thanks Andreas for your comments.
In fact, I use TextPosition. getFontSize() * TextPosition.getXScale() as the
font size. It works for most of cases. However, it doesn't work for zzz.pdf
because getFontSize() always returns 1 and getXScale() always return 0.24.
I will try with the version 761547. Thanks again.
2009/4/3 Andreas Lehmkühler (JIRA) <ji...@apache.org>
>
> [
> https://issues.apache.org/jira/browse/PDFBOX-450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695281#action_12695281]
>
> Andreas Lehmkühler commented on PDFBOX-450:
> -------------------------------------------
>
> Obviously there is a misunderstanding concerning how some text informations
> are handled within a pdf document. The fontsize is always a combination of
> the pdf-fontsize (Tf-operator) and the scaling within the textmatrix
> (Tm-operator). In a lot of documents the fontsize will be achieved through
> scaling and not by setting the pdf-fontsize to the needed value. In that
> cases the pdf-fontsize will always be 1.
> Back to the TextPosition. getFontSize() returns the pdf-fontsize and
> getXScale() the scaling factor in x-direction from the textmatrix in display
> units. I hope now it is obvious why these values doesn't match with your
> expectations.
>
> With version 761547 there is an additional method named getFontSizeInPt in
> the class TextPosition, which returns the font size in pt-units.
>
>
>
> > PDFTextStripper CAN NOT extract correct font information for some early
> produced PDF documents
> >
> ----------------------------------------------------------------------------------------------
> >
> > Key: PDFBOX-450
> > URL: https://issues.apache.org/jira/browse/PDFBOX-450
> > Project: PDFBox
> > Issue Type: Bug
> > Components: Text extraction
> > Affects Versions: 0.8.0-incubator
> > Environment: Windows XP, JDK 5.0
> > Reporter: Shengwen
> > Fix For: 0.8.0-incubator
> >
> > Attachments: 1066.pdf, zzz.pdf
> >
> >
> > PDFTextStripper can not extract correct font information from the
> attached document. When I traced into the code, I found that the
> TextPosition.getFontSize()=1 and TextPosition.getXScale() = 0.24 in all
> cases. However, the TextPosition.getFont().getAverageFontWidth() has
> different values obviously.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>