// if the mask has the wrong colorspace (PDFBOX-2057), but it is still useful
// if something goes wrong in the future and we want to have a PDF to open.
PDPage page = new PDPage();
document.addPage(page);
PDPageContentStream contentStream = new PDPageContentStream(document, page, true, false);
contentStream.drawXObject(ximage, 150, 300, ximage.getWidth(), ximage.getHeight());
contentStream.drawXObject(ximage, 200, 350, ximage.getWidth(), ximage.getHeight());
contentStream.close();
File pdfFile = new File(testResultsDir, "jpeg256file.pdf");
document.save(pdfFile);
document.close();