Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3745

Wrong character width

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6, 3.0.0 PDFBox
    • PDModel
    • None
    • Windows 10

    Description

      I tried to convert a PDF file to an image. But there is a error with the character width computation. As you can see inside the blue box, there are gaps after every umlaut mark (ä ,ö ,ü). Some characters in the font doesn't contain any width information. The distance between the character is handled by position adjustment. For example:

      [1., -278, ), -844, H, -722, ä, -556, u, -611, sliche P, -667, f, -333, lege] TJ

      I guess there is an error in the font.getWidth() implementation. If I call font.getWidth("ä") it returns 556. (Instead of 0, what would fit)

      I attached the PDF and the converted image.

      Attachments

        1. PDFBOX-3745-reduced.pdf
          61 kB
          Tilman Hausherr
        2. p421.jpg
          407 kB
          Ch. Schlatter
        3. p42.pdf
          617 kB
          Ch. Schlatter

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tilman Tilman Hausherr
            ChSch Ch. Schlatter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment