Author: tilman
Date: Wed May 27 15:51:11 2026
New Revision: 1934686
Log:
PDFBOX-6206: skip and log bad annotations when rendering
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Wed May 27 15:02:15 2026 (r1934685)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Wed May 27 15:51:11 2026 (r1934686)
@@ -696,10 +696,17 @@ public class PDPage implements COSObject
{
continue;
}
- PDAnnotation createdAnnotation =
PDAnnotation.createAnnotation(item);
- if (annotationFilter.accept(createdAnnotation))
+ try
{
- actuals.add(createdAnnotation);
+ PDAnnotation createdAnnotation =
PDAnnotation.createAnnotation(item);
+ if (annotationFilter.accept(createdAnnotation))
+ {
+ actuals.add(createdAnnotation);
+ }
+ }
+ catch (IOException ex)
+ {
+ LOG.error(ex.getMessage(), ex);
}
}
return new COSArrayList<PDAnnotation>(actuals, annots);