use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class PdfCleanUpToolTest method noninvertibleMatrixRemoveAllTest.
@Test
@LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.FAILED_TO_PROCESS_A_TRANSFORMATION_MATRIX))
public void noninvertibleMatrixRemoveAllTest() throws IOException, InterruptedException {
String fileName = "noninvertibleMatrixRemoveAllTest";
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(0, 0, 595, 842), 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 cleanUpTest14.
@Test
public void cleanUpTest14() throws IOException, InterruptedException {
String input = INPUT_PATH + "rotatedImg.pdf";
String output = OUTPUT_PATH + "rotatedImg.pdf";
String cmp = INPUT_PATH + "cmp_rotatedImg.pdf";
List<PdfCleanUpLocation> cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(97f, 405f, 480f - 97f, 445f - 405f), ColorConstants.GRAY));
cleanUp(input, output, cleanUpLocations);
compareByContent(cmp, output, OUTPUT_PATH, "diff_14");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class CleanUpTransformedImageTest method skewedGrayscaleImageBBoxCleanUpTest.
@Test
public void skewedGrayscaleImageBBoxCleanUpTest() throws Exception {
// TODO DEVSIX-5089 skewed images cleanup is not supported
String input = inputPath + "skewedGrayImage.pdf";
String output = outputPath + "skewedGrayImage.pdf";
String cmp = inputPath + "cmp_skewedGrayImage.pdf";
Rectangle cleanupRegion = new Rectangle(150, 250, 100, 100);
expectedException.expect(ArrayIndexOutOfBoundsException.class);
cleanFirstPageAndDrawCleanupRegion(cleanupRegion, input, output);
Assert.assertNull(findDifferencesBetweenOutputAndCmp(output, cmp));
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class CleanupImageWithColorSpaceTest method cleanUpTestColorSpaceJpegBaselineEncoded.
@Test
public void cleanUpTestColorSpaceJpegBaselineEncoded() throws Exception {
// cleanup jpeg image with baseline encoded data
String input = inputPath + "imgSeparationCsJpegBaselineEncoded.pdf";
String output = outputPath + "imgSeparationCsJpegBaselineEncoded.pdf";
String cmp = inputPath + "cmp_imgSeparationCsJpegBaselineEncoded.pdf";
cleanUp(input, output, Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(60f, 600f, 100f, 50f), ColorConstants.GREEN)));
compareByContent(cmp, output, outputPath, "11");
}
use of com.itextpdf.kernel.geom.Rectangle in project i7j-pdfsweep by itext.
the class CleanupImageWithColorSpaceTest method cleanUpTestColorSpace.
@Test
public void cleanUpTestColorSpace() throws Exception {
String input = inputPath + "imgSeparationCs.pdf";
String output = outputPath + "imgSeparationCs.pdf";
String cmp = inputPath + "cmp_imgSeparationCs.pdf";
cleanUp(input, output, Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(60f, 780f, 60f, 45f), ColorConstants.GREEN)));
compareByContent(cmp, output, outputPath, "9");
}
Aggregations