A job that converts a non-PDF file to a PDF file. Some source formats may have associated conversion parameters which can be set using the CreatePDFParams.

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.DOCX
});

const job = new CreatePDFJob({inputAsset});

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

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

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

Hierarchy (view full)

Constructors

  • Constructs a new CreatePDFJob instance.

    Parameters

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

      The parameters for constructing an instance of CreatePDFJob.

      • inputAsset: Asset

        The input asset for the job. Cannot be undefined.

      • Optional outputAsset?: Asset

        Asset object representing the output asset.

      • Optional params?: CreatePDFParams

        CreatePDFParams object to specify the conversion parameters for the different source media types.

    Returns CreatePDFJob

    Remarks

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

Properties

_createPDFParams?: CreatePDFParams
_inputAsset: Asset
_outputAsset?: Asset

Methods

  • Parameters

    Returns PDFServicesApiRequest

  • Parameters

    • executionContext: ExecutionContext

    Returns void

Generated using TypeDoc