use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method simpleCleanUpOnRotatedPages.
@Test
public void simpleCleanUpOnRotatedPages() throws IOException, InterruptedException {
String fileName = "simpleCleanUpOnRotatedPages";
String input = INPUT_PATH + "documentWithRotatedPages.pdf";
String output = OUTPUT_PATH + fileName + ".pdf";
String cmp = INPUT_PATH + "cmp_" + fileName + ".pdf";
List<PdfCleanUpLocation> locationsList = new ArrayList<>();
for (int i = 0; i < 4; i++) {
locationsList.add(new PdfCleanUpLocation(i + 1, new Rectangle(100, 100, 200, 100), ColorConstants.GREEN));
}
cleanUp(input, output, locationsList);
compareByContent(cmp, output, OUTPUT_PATH, "diff_pathAndIncorrectCMTest");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method cleanUpTest40.
@Test
public void cleanUpTest40() throws IOException, InterruptedException {
String input = INPUT_PATH + "emptyTj01.pdf";
String output = OUTPUT_PATH + "emptyTj01.pdf";
String cmp = INPUT_PATH + "cmp_emptyTj01.pdf";
List<PdfCleanUpLocation> cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(70f, 555f, 200f, 5f), ColorConstants.ORANGE));
cleanUp(input, output, cleanUpLocations);
compareByContent(cmp, output, OUTPUT_PATH, "diff_40");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method cleanUpTest45.
@Test
public void cleanUpTest45() throws IOException, InterruptedException {
String input = INPUT_PATH + "emptyPdf.pdf";
String output = OUTPUT_PATH + "emptyPdf.pdf";
String cmp = INPUT_PATH + "cmp_emptyPdf.pdf";
PdfAnnotation redactAnnotation = new PdfRedactAnnotation(new Rectangle(97, 405, 383, 40)).setOverlayText(new PdfString("OverlayTest")).setDefaultAppearance(new PdfString("/Helv 0 Tf 0 g"));
PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output));
pdfDocument.getFirstPage().addAnnotation(redactAnnotation);
PdfCleaner.cleanUpRedactAnnotations(pdfDocument);
pdfDocument.close();
compareByContent(cmp, output, OUTPUT_PATH, "diff_45");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method noninvertibleMatrixRemoveAllTest02.
@Test
@LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.FAILED_TO_PROCESS_A_TRANSFORMATION_MATRIX))
public void noninvertibleMatrixRemoveAllTest02() throws IOException, InterruptedException {
String fileName = "noninvertibleMatrixRemoveAllTest02";
String input = INPUT_PATH + "noninvertibleMatrix.pdf";
String output = OUTPUT_PATH + fileName + ".pdf";
String cmp = INPUT_PATH + "cmp_" + fileName + ".pdf";
PdfCleanUpLocation wholePageLocation = new PdfCleanUpLocation(1, new Rectangle(-1000, -1000, 2000, 2000), null);
cleanUp(input, output, Arrays.asList(wholePageLocation));
compareByContent(cmp, output, OUTPUT_PATH, "diff_noninvertibleMatrixRemoveAllTest");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method cleanUpTest33.
@Test
public void cleanUpTest33() throws IOException, InterruptedException {
String input = INPUT_PATH + "viewer_prefs_dict_table.pdf";
String output = OUTPUT_PATH + "complexTextPositioning.pdf";
String cmp = INPUT_PATH + "cmp_complexTextPositioning.pdf";
cleanUp(input, output, Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(300f, 370f, 215f, 270f))));
compareByContent(cmp, output, OUTPUT_PATH, "diff_33");
}
Aggregations