use of com.itextpdf.test.annotations.LogMessages in project i7j-pdfsweep by itext.
the class BigDocumentCleanUpTest method bigTaggedDocument.
@Test
@LogMessages(messages = @LogMessage(messageTemplate = IoLogMessageConstant.CREATED_ROOT_TAG_HAS_MAPPING))
public void bigTaggedDocument() throws IOException, InterruptedException {
String input = inputPath + "chapter8_Interactive_features.pdf";
String output = outputPath + "bigTaggedDocument.pdf";
String cmp = inputPath + "cmp_bigTaggedDocument.pdf";
List<Rectangle> rects = Arrays.asList(new Rectangle(60f, 80f, 460f, 65f), new Rectangle(300f, 370f, 215f, 270f));
cleanUp(input, output, initLocations(rects, 131));
compareByContent(cmp, output, outputPath, "4");
}
use of com.itextpdf.test.annotations.LogMessages in project i7j-pdfsweep by itext.
the class CleanUpAnnotationTest method cleanWatermarkAnnotation.
@Test
@LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.REDACTION_OF_ANNOTATION_TYPE_WATERMARK_IS_NOT_SUPPORTED))
public // TODO: update cmp file after DEVSIX-2471 fix
void cleanWatermarkAnnotation() throws IOException, InterruptedException {
String input = inputPath + "watermarkAnnotation.pdf";
String output = outputPath + "watermarkAnnotation.pdf";
String cmp = inputPath + "cmp_watermarkAnnotation.pdf";
cleanUp(input, output, Collections.singletonList(new PdfCleanUpLocation(1, new Rectangle(410, 410, 50, 50), ColorConstants.YELLOW)));
compareByContent(cmp, output, outputPath);
}
use of com.itextpdf.test.annotations.LogMessages in project i7j-pdfsweep by itext.
the class CleanUpCsCompareUtilTest method imageReadExceptionTest.
@Test
@LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING))
public void imageReadExceptionTest() {
PdfStream stream1 = new PdfStream();
stream1.put(PdfName.BitsPerComponent, new PdfNumber(8));
stream1.put(PdfName.ColorSpace, PdfName.DeviceCMYK);
PdfImageXObject image1 = new PdfImageXObject(stream1);
stream1 = new PdfStream();
stream1.put(PdfName.BitsPerComponent, new PdfNumber(8));
stream1.put(PdfName.ColorSpace, PdfName.DeviceCMYK);
PdfImageXObject image2 = new PdfImageXObject(stream1);
Assert.assertFalse(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2));
}
use of com.itextpdf.test.annotations.LogMessages 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.test.annotations.LogMessages in project i7j-pdfsweep by itext.
the class CleanUpTextTest method cleanZeroWidthTextInvalidFont.
@Test
@LogMessages(messages = { @LogMessage(messageTemplate = IoLogMessageConstant.FONT_DICTIONARY_WITH_NO_FONT_DESCRIPTOR), @LogMessage(messageTemplate = IoLogMessageConstant.FONT_DICTIONARY_WITH_NO_WIDTHS) })
public void cleanZeroWidthTextInvalidFont() throws IOException, InterruptedException {
String input = inputPath + "cleanZeroWidthTextInvalidFont.pdf";
String output = outputPath + "cleanZeroWidthTextInvalidFont.pdf";
String cmp = inputPath + "cmp_cleanZeroWidthTextInvalidFont.pdf";
cleanUp(input, output, Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(50, 50, 500, 500))));
compareByContent(cmp, output, outputPath);
}
Aggregations