You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2016/11/29 17:44:55 UTC

svn commit: r1771931 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Author: tilman
Date: Tue Nov 29 17:44:55 2016
New Revision: 1771931

URL: http://svn.apache.org/viewvc?rev=1771931&view=rev
Log:
PDFBOX-3589: skip double "-", as suggested by Andrea Vacondio

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1771931&r1=1771930&r2=1771931&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Tue Nov 29 17:44:55 2016
@@ -248,6 +248,12 @@ public class PDFStreamParser extends Bas
                 StringBuilder buf = new StringBuilder();
                 buf.append( c );
                 seqSource.read();
+                
+                // Ignore double negative (this is consistent with Adobe Reader)
+                if (c == '-' && seqSource.peek() == c)
+                {
+                    seqSource.read();
+                }
 
                 boolean dotNotRead = c != '.';
                 while( Character.isDigit(c = (char) seqSource.peek()) || dotNotRead && c == '.')