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

Double negative float

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.3
    • 2.0.4, 3.0.0 PDFBox
    • Parsing
    • None
    • Latest 2.0.x checked out the 22nd of November

    Description

      We have a document where the content stream contains a float with double negative so something like --242.0 and this result in a wrong operator:

        0 -242.0 72.08 TD
      

      while it should be

      -242.0 72.08 TD
      

      Compared to Acrobat Reader or pdf.js, this results in missing text when rendering the page. Here is a relevant section in pdf.js source code:

       if (ch === 0x2D) { // '-'
              sign = -1;
              ch = this.nextChar();
      
              if (ch === 0x2D) { // '-'
                // Ignore double negative (this is consistent with Adobe Reader).
                ch = this.nextChar();
              }
      } 
      

      Attachments

        1. PDFBOX-3589_float.pdf
          16 kB
          Andrea Vacondio
        2. PDFBOX-3589.pdf
          16 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            torakiki Andrea Vacondio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: