@@ -91,7 +91,7 @@ public static Set<PdfIndirectReference> getOCGsFromPage(PdfPage page) {
9191 final List <PdfAnnotation > annotations = page .getAnnotations ();
9292 for (PdfAnnotation annotation : annotations ) {
9393 //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 );
9595 }
9696 final PdfDictionary resources = page .getPdfObject ().getAsDictionary (PdfName .Resources );
9797 OcgPropertiesCopier .getUsedNonFlushedOCGsFromResources (resources , resources , ocgs ,
@@ -117,7 +117,7 @@ private static Set<PdfIndirectReference> getAllUsedNonFlushedOCGs(Map<PdfPage, P
117117 final PdfAnnotation toAnnot = toAnnotations .get (j );
118118 final PdfAnnotation fromAnnot = fromAnnotations .get (j );
119119 if (!toAnnot .getPdfObject ().isFlushed ()) {
120- getUsedNonFlushedOCGsFromAnnotation (toOcProperties , fromUsedOcgs , toAnnot , fromAnnot );
120+ getUsedNonFlushedOCGsFromAnnotation (toAnnot , fromAnnot , fromUsedOcgs , toOcProperties );
121121 }
122122 }
123123 }
@@ -130,7 +130,7 @@ private static Set<PdfIndirectReference> getAllUsedNonFlushedOCGs(Map<PdfPage, P
130130 return fromUsedOcgs ;
131131 }
132132
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 ) {
134134 OcgPropertiesCopier .getUsedNonFlushedOCGsFromOcDict (toAnnot .getPdfObject ().getAsDictionary (PdfName .OC ),
135135 fromAnnot .getPdfObject ().getAsDictionary (PdfName .OC ), fromUsedOcgs , toOcProperties );
136136 OcgPropertiesCopier .getUsedNonFlushedOCGsFromXObject (toAnnot .getNormalAppearanceObject (),
0 commit comments