@adobe/pdfservices-node-sdk
Version:
The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.
68 lines (67 loc) • 2.54 kB
TypeScript
import { PDFServicesJob } from "./PDFServicesJob";
import { Asset } from "../../io/Asset";
import { RotatePagesParams } from "../params/rotatepages/RotatePagesParams";
import { ExecutionContext } from "../../internal/ExecutionContext";
import { NotifierConfig } from "../../config/notifier/NotifierConfig";
/**
* A job that allows rotation of specific pages in a PDF file.
*
* @example
* Sample Usage:
* ```js
* 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});
* ```
*/
export declare class RotatePagesJob extends PDFServicesJob {
private readonly _inputAsset;
private readonly _outputAsset?;
private readonly _rotatePagesParams;
/**
* Constructs a new `RotatePagesJob` instance.
*
* @param params The parameters for constructing an instance of `RotatePagesJob`.
* @param params.inputAsset The input asset for the job. Cannot be undefined.
* @param params.params {@link RotatePagesParams} object containing the rotation angle and page ranges.
* Cannot be undefined.
* @param [params.outputAsset] {@link Asset} object representing the output asset.
* @remarks External assets can be set as output only when input is external asset as well.
*/
constructor(params: {
inputAsset: Asset;
params: RotatePagesParams;
outputAsset?: Asset;
});
/**
* @hidden
*/
process(executionContext: ExecutionContext, notifierConfigList?: NotifierConfig[]): Promise<string>;
private generatePDFServicesAPIRequest;
private getPageActionCommands;
}