@adobe/pdfservices-node-sdk
Version:
The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.
67 lines (59 loc) • 2.66 kB
TypeScript
import { PDFServicesJob } from "./PDFServicesJob";
import { Asset } from "../../io/Asset";
import { AutotagPDFParams } from "../params/autotagpdf/AutotagPDFParams";
import { ExecutionContext } from "../../internal/ExecutionContext";
import { NotifierConfig } from "../../config/notifier/NotifierConfig";
/**
* A job that creates PDF documents with enhanced readability from existing PDF documents.
* An optional tagging report can also be generated which contains the information
* about the tags that the tagged output PDF document contains.
*
* Accessibility tags, used by assistive technology such as screen reader are required to make PDF files compliant.
* However, the generated PDF is not guaranteed to comply with accessibility standards such as WCAG and PDF/UA as
* there could be a need to perform further downstream remediation to meet those standards.
*
* @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 job = new AutotagPDFJob({inputAsset});
const pollingURL = await pdfServices.submit({job});
const pdfServicesResponse = await pdfServices.getJobResult({
pollingURL,
resultType: AutotagPDFResult
});
const resultAsset = pdfServicesResponse.result.taggedPDF;
const streamAsset = await pdfServices.getContent({asset: resultAsset});
* ```
*/
export declare class AutotagPDFJob extends PDFServicesJob {
private readonly _inputAsset;
private readonly _autotagPDFParams?;
private readonly _outputAsset?;
/**
* Constructs a new `AutotagPDFJob` instance.
* @param params - The parameters for constructing an instance of `AutotagPDFJob`.
* @param params.inputAsset - The input asset for the job. Cannot be undefined.
* @param [params.params] - The {@link AutotagPDFParams} for the job.
* @param [params.outputAsset] - {@link Asset} object representing the output asset.
*/
constructor(params: {
inputAsset: Asset;
params?: AutotagPDFParams;
outputAsset?: Asset;
});
/**
* @hidden
*/
process(executionContext: ExecutionContext, notifyConfigList?: NotifierConfig[]): Promise<string>;
private generatePDFServicesAPIRequest;
}