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

Characters swallowed on COSString.getString()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.5, 1.8.6, 2.0.0
    • 1.8.6, 2.0.0
    • Parsing
    • None

    Description

      PDFBOX-1437 seems to have introduced a regression that causes characters like \n to be swallowed when COSString.getString() is called. PDFDocEncoding doesn't handle all valid characters.

      testStr = "Line1\nLine2\nLine3\n";
      COSString lineFeedString = new COSString(testStr);
      assertEquals(testStr, lineFeedString.getString());
      
      //Same as previous but this time as a dictionary value
      lineFeedString = new COSString(true);
      for (int i = 0; i < testStr.length(); i++) {
          lineFeedString.append(testStr.charAt(i));
      }
      assertEquals(testStr, lineFeedString.getString()); //currently fails
      

      Direct link to the change causing the regression:
      http://svn.apache.org/viewvc?view=revision&revision=1406628

      Attachments

        1. 000059.pdf
          723 kB
          Petr Slaby
        2. iae.txt
          2 kB
          Petr Slaby

        Issue Links

          Activity

            People

              jeremias@apache.org Jeremias Maerki
              jeremias@apache.org Jeremias Maerki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: