validate(ximage3, 1, 344, 287, "tiff", PDDeviceGray.NAME);
BufferedImage bim3 = ImageIO.read(new File(tiffG3Path));
checkIdent(bim3, ximage3.getRGBImage());
PDPage page = new PDPage(PDPage.PAGE_SIZE_A4);
document.addPage(page);
PDPageContentStream contentStream = new PDPageContentStream(document, page, true, false);
contentStream.drawXObject(ximage3, 0, 0, ximage3.getWidth(), ximage3.getHeight());
contentStream.close();
reader = new RandomAccessFile(new File(tiffG4Path), "r");
PDXObjectImage ximage4 = new PDCcitt(document, reader);
validate(ximage4, 1, 344, 287, "tiff", PDDeviceGray.NAME);
BufferedImage bim4 = ImageIO.read(new File(tiffG3Path));
checkIdent(bim4, ximage4.getRGBImage());
page = new PDPage(PDPage.PAGE_SIZE_A4);
document.addPage(page);
contentStream = new PDPageContentStream(document, page, true, false);
contentStream.drawXObject(ximage4, 0, 0, ximage4.getWidth(), ximage4.getHeight());
contentStream.close();
document.save(testResultsDir + "/singletiff.pdf");
document.close();
document = PDDocument.loadNonSeq(new File(testResultsDir, "singletiff.pdf"), null);