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/05/02 22:48:12 UTC
svn commit: r1742038 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java
Author: tilman
Date: Mon May 2 20:48:11 2016
New Revision: 1742038
URL: http://svn.apache.org/viewvc?rev=1742038&view=rev
Log:
PDFBOX-3335: keep the first /OCProperties
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java
Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java?rev=1742038&r1=1742037&r2=1742038&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java Mon May 2 20:48:11 2016
@@ -447,6 +447,13 @@ public class PDFMergerUtility
destCatalog.getCOSDictionary().setItem(COSName.METADATA, newStream);
}
+ COSDictionary destOCP = (COSDictionary) destCatalog.getCOSDictionary().getDictionaryObject(COSName.OCPROPERTIES);
+ COSDictionary srcOCP = (COSDictionary) srcCatalog.getCOSDictionary().getDictionaryObject(COSName.OCPROPERTIES);
+ if (destOCP == null && srcOCP != null)
+ {
+ destCatalog.getCOSDictionary().setItem(COSName.OCPROPERTIES, cloner.cloneForNewDocument(srcOCP));
+ }
+
// merge logical structure hierarchy if logical structure information is available in both source pdf and
// destination pdf
boolean mergeStructTree = false;