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

TextPosition#getIndividualWidths returns negative values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0.0
    • 1.0.0
    • Text extraction, Utilities
    • None

    Description

      I was notified by Peter Costello (peterwcostello at gmail dot com) that there has been a regression in PDFStreamSource, which results in TextPosition returning negative individual character widths. This could happen, because I only tested with TextPosition#getWidth(), but not with TextPosition#getIndividualWidths(). Below is the original message:

      Bug introduced to /pdfbox/trunk/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java on revision 885904

      Line 422 changed to:
      float widthText = glyphMatrixStDisp.getXPosition() - glyphMatrixEndDisp.getXPosition();

      Polarity of width now negative. Should be
      float widthText = glyphMatrixEndDisp.getXPosition() - glyphMatrixStDisp.getXPosition();

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vfed Villu Ruusmann
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: