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()); }