private void setUpDefaultParameters() { parameters = new RotateParameters(Rotation.DEGREES_180, PredefinedSetOfPages.ALL_PAGES); parameters.addSource(shortInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE); }
private void setUpRotateSpecificPages() { parameters = new RotateParameters(Rotation.DEGREES_90); parameters.addPageRange(new PageRange(2, 4)); parameters.addSource(shortInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE); }
private void setUpParametersWithVersionPrefixAndCompressionSpecified() { parameters = new RotateParameters(Rotation.DEGREES_180, PredefinedSetOfPages.ALL_PAGES); parameters.setCompress(true); parameters.setOutputPrefix("test_prefix_"); parameters.setVersion(PdfVersion.VERSION_1_6); parameters.addSource(shortInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.SKIP); }
private void setUpRotateMultipleInputNotRangesContained() { parameters = new RotateParameters(Rotation.DEGREES_90); parameters.addPageRange(new PageRange(2, 4)); parameters.addPageRange(new PageRange(15, 15)); parameters.addSource(shortInput()); parameters.addSource(mediumInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE); }
@Test public void testDifferentRotations() throws IOException { parameters = new RotateParameters(); parameters.addPageRange(new PageRange(1, 2), Rotation.DEGREES_90); parameters.addPageRange(new PageRange(3, 4), Rotation.DEGREES_180); parameters.addSource(shortInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4).forEachPdfOutput(d -> { assertEquals(90, d.getPage(0).getRotation()); assertEquals(90, d.getPage(1).getRotation()); assertEquals(180, d.getPage(2).getRotation()); assertEquals(180, d.getPage(3).getRotation()); }); } }