pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1750363 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
Date Mon, 27 Jun 2016 15:42:15 GMT
Author: tilman
Date: Mon Jun 27 15:42:15 2016
New Revision: 1750363

URL: http://svn.apache.org/viewvc?rev=1750363&view=rev
Log:
PDFBOX-3401: call PDXObject.createXObject() only if parameter is a COSStream

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java?rev=1750363&r1=1750362&r2=1750363&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
Mon Jun 27 15:42:15 2016
@@ -21,6 +21,7 @@ import java.io.IOException;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 import org.apache.pdfbox.pdmodel.graphics.PDXObject;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
@@ -88,10 +89,13 @@ public class PDObjectReference implement
         }
         try
         {
-            PDXObject xobject = PDXObject.createXObject(obj, null); // <-- TODO: valid?
-            if (xobject != null)
+            if (obj instanceof COSStream)
             {
-                return xobject;
+                PDXObject xobject = PDXObject.createXObject(obj, null); // <-- TODO: valid?
+                if (xobject != null)
+                {
+                    return xobject;
+                }
             }
             COSDictionary objDictionary  = (COSDictionary)obj;
             PDAnnotation annotation = PDAnnotation.createAnnotation(obj);



Mime
View raw message