pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1813602 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java
Date Sat, 28 Oct 2017 10:42:09 GMT
Author: tilman
Date: Sat Oct 28 10:42:09 2017
New Revision: 1813602

URL: http://svn.apache.org/viewvc?rev=1813602&view=rev
Log:
PDFBOX-3950: be lenient if resource is missing

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java?rev=1813602&r1=1813601&r2=1813602&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetGraphicsStateParameters.java
Sat Oct 28 10:42:09 2017
@@ -19,6 +19,8 @@ package org.apache.pdfbox.contentstream.
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState;
@@ -33,6 +35,8 @@ import org.apache.pdfbox.contentstream.o
  */
 public class SetGraphicsStateParameters extends OperatorProcessor
 {
+    private static final Log LOG = LogFactory.getLog(SetGraphicsStateParameters.class);
+
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
@@ -51,7 +55,8 @@ public class SetGraphicsStateParameters
         PDExtendedGraphicsState gs = context.getResources().getExtGState(graphicsName);
         if (gs == null)
         {
-            throw new IOException("name for 'gs' operator not found in resources: /" + graphicsName.getName());
+            LOG.error("name for 'gs' operator not found in resources: /" + graphicsName.getName());
+            return;
         }
         gs.copyIntoGraphicsState( context.getGraphicsState() );
     }



Mime
View raw message