A job that allows to rearrange pages in a PDF file according to the specified order.

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 ReorderPagesParams({
asset: inputAsset,
pageRanges: new PageRanges().addSinglePage(3).addRange(1,2)
});

const job = new ReorderPagesJob({params});

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

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

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

Hierarchy (view full)

Constructors

  • Constructs a new ReorderPagesJob instance.

    Parameters

    • params: {
          outputAsset?: Asset;
          params: ReorderPagesParams;
      }

      The parameters for constructing an instance of ReorderPagesJob.

    Returns ReorderPagesJob

    Remarks

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

Properties

_outputAsset?: Asset
_reorderPagesParams: ReorderPagesParams

Methods

  • Parameters

    Returns PDFServicesApiRequest

  • Parameters

    • executionContext: ExecutionContext

    Returns void

Generated using TypeDoc