A job that converts a PDF file into a linearized (also known as "web optimized") PDF file. Such PDF files are optimized for incremental access in network environments.

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 job = new LinearizePDFJob({inputAsset});

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

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

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

Hierarchy (view full)

Constructors

  • Constructs a new LinearizePDFJob instance.

    Parameters

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

      The parameters for constructing an instance of LinearizePDFJob.

      • inputAsset: Asset

        The input asset for the job. Cannot be undefined.

      • Optional outputAsset?: Asset

        Asset object representing the output asset.

    Returns LinearizePDFJob

    Remarks

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

Properties

_inputAsset: Asset
_outputAsset?: Asset

Methods

  • Parameters

    Returns PDFServicesApiRequest

  • Parameters

    • executionContext: ExecutionContext

    Returns void

Generated using TypeDoc