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

Example

Sample Usage:

        const readStream = fs.createReadStream("<SOURCE_PATH>");

const credentials = new ServicePrincipalCredentials({
clientId: process.env.PDF_SERVICES_CLIENT_ID,
clientSecret: process.env.PDF_SERVICES_CLIENT_SECRET
});

const pdfServices = new PDFServices({credentials});

const inputAsset = await pdfServices.upload({
readStream,
mimeType: MimeType.PDF
});

const params = new RotatePagesParams()
.setAngleToRotatePagesBy(Angle._90);

const job = new RotatePagesJob({inputAsset, params});

const pollingURL = await pdfServices.submit({job});

const pdfServicesResponse = await pdfServices.getJobResult({
pollingURL,
resultType: RotatePagesResult
});

const resultAsset = pdfServicesResponse.result.asset;
const streamAsset = await pdfServices.getContent({asset: resultAsset});

Hierarchy (view full)

Constructors

  • Constructs a new RotatePagesJob instance.

    Parameters

    • params: {
          inputAsset: Asset;
          outputAsset?: Asset;
          params: RotatePagesParams;
      }

      The parameters for constructing an instance of RotatePagesJob.

      • inputAsset: Asset

        The input asset for the job. Cannot be undefined.

      • Optional outputAsset?: Asset

        Asset object representing the output asset.

      • params: RotatePagesParams

        RotatePagesParams object containing the rotation angle and page ranges. Cannot be undefined.

    Returns RotatePagesJob

    Remarks

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

Properties

_inputAsset: Asset
_outputAsset?: Asset
_rotatePagesParams: RotatePagesParams

Methods

  • Parameters

    Returns PDFServicesApiRequest

  • Returns PageActionCommand[]

  • Parameters

    • executionContext: ExecutionContext

    Returns void

Generated using TypeDoc