pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1771931 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Date Tue, 29 Nov 2016 17:44:55 GMT
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 == '.')



Mime
View raw message