Skip to content

Commit e156c33

Browse files
committed
PDFBOX-6206: skip and log bad annotations when rendering
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1934687 13f79535-47bb-0310-9956-ffa450edef68
1 parent a71c567 commit e156c33

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • pdfbox/src/main/java/org/apache/pdfbox/pdmodel

‎pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,10 +808,17 @@ public List<PDAnnotation> getAnnotations(AnnotationFilter annotationFilter) thro
808808
{
809809
continue;
810810
}
811-
PDAnnotation createdAnnotation = PDAnnotation.createAnnotation(item);
812-
if (annotationFilter.accept(createdAnnotation))
811+
try
812+
{
813+
PDAnnotation createdAnnotation = PDAnnotation.createAnnotation(item);
814+
if (annotationFilter.accept(createdAnnotation))
815+
{
816+
actuals.add(createdAnnotation);
817+
}
818+
}
819+
catch (IOException ex)
813820
{
814-
actuals.add(createdAnnotation);
821+
LOG.error(ex.getMessage(), ex);
815822
}
816823
}
817824
return new COSArrayList<>(actuals, annots);

0 commit comments

Comments
 (0)