A job that allows clients to apply an electronic seal onto various PDF documents such as agreements, invoices, and more.

To know more about PDF Electronic Seal, please see the documentation.

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 sourceFileAsset = await pdfServices.upload({
readStream: readStream,
mimeType: MimeType.PDF
});

const certificateCredentials = new CSCCredential({
providerName: "<PROVIDER_NAME>",
credentialId: "<CREDENTIAL_ID>",
pin: "<PIN>",
authorizationContext: new CSCAuthContext({accessToken: "<ACCESS_TOKEN>"})
});

const sealFieldName = "Signature1";
const sealFieldOptions = new FieldOptions({
fieldName: sealFieldName,
pageNumber: 1,
location: new FieldLocation({
left: 150,
top: 250,
right: 350,
bottom: 200
})
});

const params = new PDFElectronicSealParams({
certificateCredentials,
sealFieldOptions,
});

const job = new PDFElectronicSealJob({
inputAsset: sourceFileAsset,
params,
});

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

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

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

Hierarchy (view full)

Constructors

Properties

_inputDocumentAsset: Asset
_outputAsset?: Asset
_pdfElectronicSealParams: PDFElectronicSealParams
_sealImageAsset?: Asset

Methods

  • Parameters

    Returns PDFServicesApiRequest

  • Parameters

    • executionContext: ExecutionContext

    Returns void

Generated using TypeDoc