Search in sources :

Example 11 with PdfAutoSweepTools

use of com.itextpdf.pdfcleanup.autosweep.PdfAutoSweepTools in project i7j-pdfsweep by itext.

the class PdfCleaner method autoSweepCleanUp.

/**
 * Perform cleanup of areas of interest based on a given cleanup strategy.
 * Note, use methods with InputStream/OutputStream params if you don't want to consume itext-core product license
 * limits.
 *
 * @param pdfPage    the {@link PdfPage} to which cleaned up applies
 * @param strategy   cleanup strategy to be used
 * @param properties additional properties for cleanUp
 *
 * @throws IOException if an I/O error occurs
 */
public static void autoSweepCleanUp(PdfPage pdfPage, ICleanupStrategy strategy, CleanUpProperties properties) throws IOException {
    List<PdfCleanUpLocation> cleanUpLocations = new PdfAutoSweepTools(strategy).getPdfCleanUpLocations(pdfPage);
    cleanUp(pdfPage.getDocument(), cleanUpLocations, properties);
}
Also used : PdfAutoSweepTools(com.itextpdf.pdfcleanup.autosweep.PdfAutoSweepTools)

Aggregations

PdfAutoSweepTools (com.itextpdf.pdfcleanup.autosweep.PdfAutoSweepTools)11 PdfDocument (com.itextpdf.kernel.pdf.PdfDocument)5 PdfReader (com.itextpdf.kernel.pdf.PdfReader)5 PdfWriter (com.itextpdf.kernel.pdf.PdfWriter)5 CompositeCleanupStrategy (com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy)5 RegexBasedCleanupStrategy (com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy)5 ExtendedITextTest (com.itextpdf.test.ExtendedITextTest)5 IntegrationTest (com.itextpdf.test.annotations.type.IntegrationTest)5 Test (org.junit.Test)5 ConfirmEvent (com.itextpdf.commons.actions.confirmations.ConfirmEvent)2 ByteArrayOutputStream (com.itextpdf.io.source.ByteArrayOutputStream)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 List (java.util.List)1