From f00ddf1c28b1abc5b4ffde4dfbab79f92a57131b Mon Sep 17 00:00:00 2001 From: Koen van Besien Date: Fri, 13 May 2022 17:29:16 +0200 Subject: [PATCH] fix dictionary casting for issue #729 --- openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java b/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java index 22bf5b3cd..bb62a2372 100644 --- a/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java +++ b/openpdf/src/main/java/com/lowagie/text/pdf/PdfWriter.java @@ -2489,7 +2489,7 @@ private void addASEvent(PdfName event, PdfName category) { PdfArray arr = new PdfArray(); for (PdfOCG o : documentOCG) { PdfLayer layer = (PdfLayer) o; - PdfDictionary usage = (PdfDictionary) layer.get(PdfName.USAGE); + PdfDictionary usage = layer.getAsDict(PdfName.USAGE); if (usage != null && usage.get(category) != null) arr.add(layer.getRef()); }