PDFBox
  1. PDFBox
  2. PDFBOX-583

TextPosition#getIndividualWidths returns negative values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.0
    • Component/s: Text extraction, Utilities
    • Labels:
      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();

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Villu Ruusmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development