You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2016/04/21 07:23:55 UTC

svn commit: r1740230 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/PDFMergerUtility.java

Author: tilman
Date: Thu Apr 21 05:23:55 2016
New Revision: 1740230

URL: http://svn.apache.org/viewvc?rev=1740230&view=rev
Log:
PDFBOX-3323: change new API from last commit to align with document catalog API

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=1740230&r1=1740229&r2=1740230&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 Thu Apr 21 05:23:55 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.pdfbox.multipdf;
 
-import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -74,7 +73,7 @@ public class PDFMergerUtility
     private OutputStream destinationStream;
     private boolean ignoreAcroFormErrors = false;
     private PDDocumentInformation destinationDocumentInformation = null;
-    private byte[] destinationXmpMetadata = null;
+    private PDMetadata destinationMetadata = null;
 
     /**
      * Instantiate a new PDFMergerUtility.
@@ -148,25 +147,25 @@ public class PDFMergerUtility
     }
 
     /**
-     * Set the destination XMP metadata that is to be set in {@link #mergeDocuments(org.apache.pdfbox.io.MemoryUsageSetting)
+     * Set the destination metadata that is to be set in {@link #mergeDocuments(org.apache.pdfbox.io.MemoryUsageSetting)
      * }. The default is null, which means that it is ignored.
      *
-     * @return The destination XMP metadata.
+     * @return The destination metadata.
      */
-    public byte[] getDestinationXmpMetadata()
+    public PDMetadata getDestinationMetadata()
     {
-        return destinationXmpMetadata;
+        return destinationMetadata;
     }
 
     /**
-     * Set the destination XMP metadata that is to be set in {@link #mergeDocuments(org.apache.pdfbox.io.MemoryUsageSetting)
+     * Set the destination metadata that is to be set in {@link #mergeDocuments(org.apache.pdfbox.io.MemoryUsageSetting)
      * }. The default is null, which means that it is ignored.
      *
-     * @param xmp The destination XMP metadata.
+     * @param meta The destination metadata.
      */
-    public void setXMPMetadata(byte[] xmp)
+    public void setDestinationMetadata(PDMetadata meta)
     {
-        destinationXmpMetadata = xmp;
+        destinationMetadata = meta;
     }
 
     /**
@@ -267,10 +266,9 @@ public class PDFMergerUtility
                 {
                     destination.setDocumentInformation(destinationDocumentInformation);
                 }
-                if (destinationXmpMetadata != null)
+                if (destinationMetadata != null)
                 {
-                    PDMetadata meta = new PDMetadata(destination, new ByteArrayInputStream(destinationXmpMetadata));
-                    destination.getDocumentCatalog().setMetadata(meta);
+                    destination.getDocumentCatalog().setMetadata(destinationMetadata);
                 }
                 
                 if (destinationStream == null)