Class PdfAnnotationFlattener

java.lang.Object
com.itextpdf.kernel.utils.PdfAnnotationFlattener

public class PdfAnnotationFlattener extends Object
Utility class for flattening annotations.

This class can be used to remove interactive elements from a PDF document.

  • Constructor Details

    • PdfAnnotationFlattener

      public PdfAnnotationFlattener (PdfAnnotationFlattenFactory pdfAnnotationFlattenFactory)
      Creates a new instance of PdfAnnotationFlattener.
      Parameters:
      pdfAnnotationFlattenFactory - the factory for creating annotation flatten workers
    • PdfAnnotationFlattener

      public PdfAnnotationFlattener()
      Creates a new instance of PdfAnnotationFlattener. The default factory will be used for creating annotation flatten workers.
  • Method Details

    • flatten

      public List<PdfAnnotation> flatten (List<PdfAnnotation> annotationsToFlatten)
      Flattens the annotations on the page according to the defined implementation of IAnnotationFlattener.
      Parameters:
      annotationsToFlatten - the annotations that should be flattened.
      Returns:
      the list of annotations that were not flattened successfully
    • flatten

      public List<PdfAnnotation> flatten (PdfDocument document)
      Flattens the annotations on the page according to the defined implementation of IAnnotationFlattener.
      Parameters:
      document - the document that contains the annotations that should be flattened.
      Returns:
      the list of annotations that were not flattened successfully