Package com.itextpdf.pdfcleanup
Class PdfCleanUpTool
java.lang.Object
com.itextpdf.pdfcleanup.PdfCleanUpTool
Represents the main mechanism for cleaning a PDF document.
-
Constructor Summary
ConstructorDescriptionPdfCleanUpTool
(com.itextpdf.kernel.pdf.PdfDocument pdfDocument) Creates aPdfCleanUpTool
object.PdfCleanUpTool
(com.itextpdf.kernel.pdf.PdfDocument pdfDocument, boolean cleanRedactAnnotations, CleanUpProperties properties) Creates aPdfCleanUpTool
object.PdfCleanUpTool
(com.itextpdf.kernel.pdf.PdfDocument pdfDocument, List<PdfCleanUpLocation> cleanUpLocations, CleanUpProperties properties) Creates aPdfCleanUpTool
object based on the givenList
ofPdfCleanUpLocation
s representing regions to be erased from the document. -
Method Summary
Modifier and TypeMethodDescriptionaddCleanupLocation
(PdfCleanUpLocation cleanUpLocation) Adds aPdfCleanUpLocation
to be cleaned up.void
cleanUp()
Cleans the document by erasing all the areas which are provided or extracted from redaction annotations.
-
Constructor Details
-
PdfCleanUpTool
public PdfCleanUpTool(com.itextpdf.kernel.pdf.PdfDocument pdfDocument) Creates aPdfCleanUpTool
object. No regions for erasing are specified. UseaddCleanupLocation(PdfCleanUpLocation)
method to set regions to be erased from the document.- Parameters:
-
pdfDocument
- APdfDocument
object representing the document to which redaction applies.
-
PdfCleanUpTool
public PdfCleanUpTool(com.itextpdf.kernel.pdf.PdfDocument pdfDocument, boolean cleanRedactAnnotations, CleanUpProperties properties) Creates aPdfCleanUpTool
object. IfcleanRedactAnnotations
is true, regions to be erased are extracted from the redact annotations contained inside the given document. Those redact annotations will be removed from the resultant document. IfcleanRedactAnnotations
is false, then no regions for erasing are specified. In that case useaddCleanupLocation(PdfCleanUpLocation)
method to set regions to be erased from the document.- Parameters:
-
pdfDocument
- APdfDocument
object representing the document to which redaction applies. -
cleanRedactAnnotations
- if true - regions to be erased are extracted from the redact annotations contained -
properties
- additional properties for clean-up process inside the given document.
-
PdfCleanUpTool
public PdfCleanUpTool(com.itextpdf.kernel.pdf.PdfDocument pdfDocument, List<PdfCleanUpLocation> cleanUpLocations, CleanUpProperties properties) Creates aPdfCleanUpTool
object based on the givenList
ofPdfCleanUpLocation
s representing regions to be erased from the document.- Parameters:
-
cleanUpLocations
- list of locations to be cleaned upPdfCleanUpLocation
-
pdfDocument
- aPdfDocument
object representing the document to which redaction applies. -
properties
- additional properties for clean-up process
-
-
Method Details
-
addCleanupLocation
Adds aPdfCleanUpLocation
to be cleaned up.- Parameters:
-
cleanUpLocation
- aPdfCleanUpLocation
to be cleaned up - Returns:
-
this
PdfCleanUpTool
-
cleanUp
Cleans the document by erasing all the areas which are provided or extracted from redaction annotations.- Throws:
-
IOException
- IOException
-