Package com.itextpdf.kernel.utils
Class PdfAnnotationFlattener
java.lang.Object
com.itextpdf.kernel.utils.PdfAnnotationFlattener
Utility class for flattening annotations.
This class can be used to remove interactive elements from a PDF document.
-
Constructor Summary
ConstructorDescriptionCreates a new instance ofPdfAnnotationFlattener
.PdfAnnotationFlattener
(PdfAnnotationFlattenFactory pdfAnnotationFlattenFactory) Creates a new instance ofPdfAnnotationFlattener
. -
Method Summary
Modifier and TypeMethodDescriptionflatten
(PdfDocument document) Flattens the annotations on the page according to the defined implementation ofIAnnotationFlattener
.flatten
(List<PdfAnnotation> annotationsToFlatten) Flattens the annotations on the page according to the defined implementation ofIAnnotationFlattener
.
-
Constructor Details
-
PdfAnnotationFlattener
Creates a new instance ofPdfAnnotationFlattener
.- Parameters:
-
pdfAnnotationFlattenFactory
- the factory for creating annotation flatten workers
-
PdfAnnotationFlattener
public PdfAnnotationFlattener()Creates a new instance ofPdfAnnotationFlattener
. The default factory will be used for creating annotation flatten workers.
-
-
Method Details
-
flatten
Flattens the annotations on the page according to the defined implementation ofIAnnotationFlattener
.- Parameters:
-
annotationsToFlatten
- the annotations that should be flattened. - Returns:
- the list of annotations that were not flattened successfully
-
flatten
Flattens the annotations on the page according to the defined implementation ofIAnnotationFlattener
.- Parameters:
-
document
- the document that contains the annotations that should be flattened. - Returns:
- the list of annotations that were not flattened successfully
-