@Test
public void expandPagesYesBoxes() throws IOException, TaskIOException {

    try (PDDocument document = PDFParser.parse(SeekableSources
            .inMemorySeekableSourceFrom(getClass().getClassLoader().getResourceAsStream("pdf/one_page.pdf")))) {
        PDPage page = document.getPage(0);
        PDRectangle yesBox = new PDRectangle(0, 0, 200, 400);
        PDRectangle cropBox = new PDRectangle(0, 0, 400, 800);
        page.setCropBox(cropBox);
        page.setArtBox(yesBox);
        page.setTrimBox(yesBox);
        page.setBleedBox(yesBox);
        PdfScaler scaler = new PdfScaler(ScaleType.PAGE);
        scaler.scale(document, 1.5);
        assertEquals(new PDRectangle(0, 0, 892.5f, 1263f), page.getMediaBox());
        assertEquals(new PDRectangle(0, 0, 600, 1200), page.getCropBox());
        assertEquals(new PDRectangle(0, 0, 300, 600), page.getArtBox());
        assertEquals(new PDRectangle(0, 0, 300, 600), page.getBleedBox());
        assertEquals(new PDRectangle(0, 0, 300, 600), page.getTrimBox());
    }
}