pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1670722 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
Date Wed, 01 Apr 2015 16:36:21 GMT
Author: tilman
Date: Wed Apr  1 16:36:21 2015
New Revision: 1670722

URL: http://svn.apache.org/r1670722
Log:
PDFBOX-2739: throw exception if document closed

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java?rev=1670722&r1=1670721&r2=1670722&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java Wed
Apr  1 16:36:21 2015
@@ -223,6 +223,14 @@ public class PDFMergerUtility
      */
     public void appendDocument(PDDocument destination, PDDocument source) throws IOException
     {
+        if (source.getDocument().isClosed())
+        {
+            throw new IOException("Error: source PDF is closed.");
+        }
+        if (destination.getDocument().isClosed())
+        {
+            throw new IOException("Error: destination PDF is closed.");
+        }
         if (destination.isEncrypted())
         {
             throw new IOException("Error: destination PDF is encrypted, can't append encrypted
PDF documents.");



Mime
View raw message