@@ -91,7 +91,7 @@ public static Set<PdfIndirectReference> getOCGsFromPage(PdfPage page) {
91
91
final List <PdfAnnotation > annotations = page .getAnnotations ();
92
92
for (PdfAnnotation annotation : annotations ) {
93
93
//Pass null instead of catalog OCProperties value, to include ocg clashing with catalog
94
- getUsedNonFlushedOCGsFromAnnotation (null , ocgs , annotation , annotation );
94
+ getUsedNonFlushedOCGsFromAnnotation (annotation , annotation , ocgs , null );
95
95
}
96
96
final PdfDictionary resources = page .getPdfObject ().getAsDictionary (PdfName .Resources );
97
97
OcgPropertiesCopier .getUsedNonFlushedOCGsFromResources (resources , resources , ocgs ,
@@ -117,7 +117,7 @@ private static Set<PdfIndirectReference> getAllUsedNonFlushedOCGs(Map<PdfPage, P
117
117
final PdfAnnotation toAnnot = toAnnotations .get (j );
118
118
final PdfAnnotation fromAnnot = fromAnnotations .get (j );
119
119
if (!toAnnot .getPdfObject ().isFlushed ()) {
120
- getUsedNonFlushedOCGsFromAnnotation (toOcProperties , fromUsedOcgs , toAnnot , fromAnnot );
120
+ getUsedNonFlushedOCGsFromAnnotation (toAnnot , fromAnnot , fromUsedOcgs , toOcProperties );
121
121
}
122
122
}
123
123
}
@@ -130,7 +130,7 @@ private static Set<PdfIndirectReference> getAllUsedNonFlushedOCGs(Map<PdfPage, P
130
130
return fromUsedOcgs ;
131
131
}
132
132
133
- private static void getUsedNonFlushedOCGsFromAnnotation (PdfDictionary toOcProperties , Set <PdfIndirectReference > fromUsedOcgs , PdfAnnotation toAnnot , PdfAnnotation fromAnnot ) {
133
+ private static void getUsedNonFlushedOCGsFromAnnotation (PdfAnnotation toAnnot , PdfAnnotation fromAnnot , Set <PdfIndirectReference > fromUsedOcgs , PdfDictionary toOcProperties ) {
134
134
OcgPropertiesCopier .getUsedNonFlushedOCGsFromOcDict (toAnnot .getPdfObject ().getAsDictionary (PdfName .OC ),
135
135
fromAnnot .getPdfObject ().getAsDictionary (PdfName .OC ), fromUsedOcgs , toOcProperties );
136
136
OcgPropertiesCopier .getUsedNonFlushedOCGsFromXObject (toAnnot .getNormalAppearanceObject (),
0 commit comments