Author: tilman
Date: Mon May 26 08:43:27 2025
New Revision: 1925812
URL: http://svn.apache.org/viewvc?rev=1925812&view=rev
Log:
PDFBOX-6009: use one annotDictMap for each destination document and make a list
of it for postprocessing
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java?rev=1925812&r1=1925811&r2=1925812&view=diff
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
(original)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Mon May 26 08:43:27 2025
@@ -83,7 +83,8 @@ public class Splitter
private Map<COSDictionary, COSDictionary> pageDictMap; // map old page =>
new page for the current destination document
private List<Map<COSDictionary, COSDictionary>> pageDictMaps; // list of
these maps for all destination documents
private Map<COSDictionary, COSDictionary> structDictMap;
- private Map<COSDictionary, COSDictionary> annotDictMap;
+ private List<Map<COSDictionary, COSDictionary>> annotDictMaps; // map old
annotation => new annotation for the current destination document
+ private Map<COSDictionary, COSDictionary> annotDictMap; // list of these
maps for all destination documents
private Map<PDPageDestination,PDPage> destToFixMap;
private Set<String> idSet;
private Set<COSName> roleSet;
@@ -129,6 +130,7 @@ public class Splitter
destinationDocuments = new ArrayList<PDDocument>();
sourceDocument = document;
pageDictMaps = new ArrayList<Map<COSDictionary, COSDictionary>>();
+ annotDictMaps = new ArrayList<Map<COSDictionary, COSDictionary>>();
destToFixMap = new HashMap<PDPageDestination,PDPage>();
annotDictMap = new HashMap<COSDictionary, COSDictionary>();
idSet = new HashSet<String>();
@@ -140,6 +142,7 @@ public class Splitter
{
PDDocument destinationDocument = destinationDocuments.get(i);
pageDictMap = pageDictMaps.get(i);
+ annotDictMap = annotDictMaps.get(i);
cloneStructureTree(destinationDocument);
fixDestinations(destinationDocument);
}
@@ -706,6 +709,8 @@ public class Splitter
destinationDocuments.add(currentDestinationDocument);
pageDictMap = new HashMap<COSDictionary, COSDictionary>();
pageDictMaps.add(pageDictMap);
+ annotDictMap = new HashMap<COSDictionary, COSDictionary>();
+ annotDictMaps.add(annotDictMap);
}
}