@adobe/pdfservices-node-sdk
Version:
The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.
71 lines (70 loc) • 2.6 kB
TypeScript
import { PDFServicesJob } from "./PDFServicesJob";
import { Asset } from "../../io/Asset";
import { DeletePagesParams } from "../params/deletepages/DeletePagesParams";
import { ExecutionContext } from "../../internal/ExecutionContext";
import { NotifierConfig } from "../../config/notifier/NotifierConfig";
/**
* A job that deletes pages from 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 pageRangeForDeletion = new PageRanges().addSinglePage(1);
*
* const params = new DeletePagesParams({
* pageRanges: pageRangeForDeletion
* });
*
* const job = new DeletePagesJob({inputAsset, params});
*
* const pollingURL = await pdfServices.submit({job});
*
* const pdfServicesResponse = await pdfServices.getJobResult({
* pollingURL,
* resultType: DeletePagesResult
* });
*
* const resultAsset = pdfServicesResponse.result.asset;
* const streamAsset = await pdfServices.getContent({asset: resultAsset});
* ```
*/
export declare class DeletePagesJob extends PDFServicesJob {
private readonly _inputAsset;
private readonly _deletePagesParams;
private readonly _outputAsset?;
/**
* Constructs a new `DeletePagesJob` instance.
*
* @param params The parameters for constructing an instance of `DeletePagesJob`.
* @param params.inputAsset The input asset for the job. Cannot be undefined.
* @param params.params {@link DeletePagesParams} object containing the page ranges to be deleted.
* 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: DeletePagesParams;
outputAsset?: Asset;
});
/**
* @hidden
*/
process(executionContext: ExecutionContext, notifierConfigList?: NotifierConfig[]): Promise<string>;
private generatePDFServicesAPIRequest;
private getPageActionCommands;
}