Show / Hide Table of Contents

Class RotatePagesJob

A job that allows rotation of specific pages in a PDF file.

Inheritance
System.Object
PDFServicesJob
RotatePagesJob
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class RotatePagesJob : PDFServicesJob
Examples

Sample Usage:

    using Stream inputStream = File.OpenRead("<SOURCE_PATH>");

    ICredentials credentials = new ServicePrincipalCredentials(
        Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_ID"),
        Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_SECRET"));

    PDFServices pdfServices = new PDFServices(credentials);

    IAsset asset = pdfServices.Upload(inputStream, PDFServicesMediaType.PDF.GetMIMETypeValue());

    PageRanges firstPageRange = new PageRanges();
    pageRangeForDeletion.addSinglePage(1);

    RotatePagesParams rotatePagesParams = RotatePagesParams.RotatePagesParamsBuilder()
        .withAngleToRotatePagesBy(Angle._90, firstPageRange)
        .Build();
    RotatePagesJob rotatePagesJob = new RotatePagesJob(asset, rotatePagesParams);
    String location = pdfServices.Submit(rotatePagesJob);
    PDFServicesResponse<RotatePagesResult> pdfServicesResponse =
        pdfServices.GetJobResult<RotatePagesResult>(location, typeof(RotatePagesResult));

    IAsset resultAsset = pdfServicesResponse.Result.Asset;
    StreamAsset streamAsset = pdfServices.GetContent(resultAsset);

Constructors

RotatePagesJob(IAsset, RotatePagesParams)

Constructs a new RotatePagesJob instance.

Declaration
public RotatePagesJob(IAsset asset, RotatePagesParams rotatePagesParams)
Parameters
Type Name Description
IAsset asset

The input IAsset for the job; can not be null.

RotatePagesParams rotatePagesParams

The input RotatePagesParams object containing the rotation angle and page ranges; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

Declaration
public RotatePagesJob SetOutput(IAsset asset)
Parameters
Type Name Description
IAsset asset

IAsset object representing the output asset; can not be null.

Returns
Type Description
RotatePagesJob

RotatePagesJob instance

Remarks

External assets can be set as output only when input is external asset as well

In This Article
  • Constructors
    • RotatePagesJob(IAsset, RotatePagesParams)
  • Methods
    • SetOutput(IAsset)
Back to top Copyright © 2020 Adobe. All rights reserved.