Class RotatePagesJob

  • public class RotatePagesJob
    extends PDFServicesJob
    A job that allows rotation of specific pages in a PDF file.

    Sample Usage:

                 InputStream inputStream = new FileInputStream(new File("SOURCE_PATH"));
                 Credentials credentials = new ServicePrincipalCredentials(
                 PDFServices pdfServices = new PDFServices(credentials);
                 Asset asset = pdfServices.upload(inputStream, PDFServicesMediaType.PDF.getMediaType());
                 PageRanges firstPageRange = new PageRanges();
                 RotatePagesParams rotatePagesParams = RotatePagesParams.rotatePagesParamsBuilder()
                         .withAngleToRotatePagesBy(Angle._90, firstPageRange)
                 RotatePagesJob rotatePagesJob = new RotatePagesJob(asset, rotatePagesParams);
                 String location = pdfServices.submit(rotatePagesJob);
                 PDFServicesResponse<RotatePagesResult> pdfServicesResponse = pdfServices.getJobResult(location, RotatePagesResult.class);
                 Asset resultAsset = pdfServicesResponse.getResult().getAsset();
                 StreamAsset streamAsset = pdfServices.getContent(resultAsset);
    • Constructor Detail

      • RotatePagesJob

        public RotatePagesJob​(Asset asset,
                              RotatePagesParams rotatePagesParams)
        Constructs a new RotatePagesJob instance.
        asset - Asset object containing the input file; can not be null.
        rotatePagesParams - RotatePagesParams object containing the rotation angle and page ranges; can not be null.
    • Method Detail

      • setOutput

        public RotatePagesJob setOutput​(Asset asset)
        Sets the output asset for the job. @note External assets can be set as output only when input is external asset as well
        asset - Asset object representing the output asset; can not be null.
        RotatePagesJob instance