pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1840486 - /pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
Date Mon, 10 Sep 2018 17:36:12 GMT
Author: tilman
Date: Mon Sep 10 17:36:12 2018
New Revision: 1840486

URL: http://svn.apache.org/viewvc?rev=1840486&view=rev
Log:
PDFBOX-4316: delete all 3 parameters of with " operator, thanks Michael Klink

Modified:
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java?rev=1840486&r1=1840485&r2=1840486&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
Mon Sep 10 17:36:12 2018
@@ -83,15 +83,24 @@ public class RemoveAllText
                         if( token instanceof PDFOperator )
                         {
                             PDFOperator op = (PDFOperator)token;
-                            if( op.getOperation().equals( "TJ") || op.getOperation().equals(
"Tj" ))
+                            if ("TJ".equals(op.getOperation()) ||
+                                "Tj".equals(op.getOperation()) ||
+                                "'".equals(op.getOperation()))
                             {
                                 //remove the one argument to this operator
                                 newTokens.remove( newTokens.size() -1 );
                                 continue;
                             }
+                            else if ("\"".equals(op.getOperation()))
+                            {
+                                // remove the 3 arguments to this operator
+                                newTokens.remove(newTokens.size() - 1);
+                                newTokens.remove(newTokens.size() - 1);
+                                newTokens.remove(newTokens.size() - 1);
+                                continue;
+                            }
                         }
                         newTokens.add( token );
-
                     }
                     PDStream newContents = new PDStream( document );
                     ContentStreamWriter writer = new ContentStreamWriter( newContents.createOutputStream()
);



Mime
View raw message