@adobe/pdftools-extract-node-sdk
Version:
The Document Services PDF Tools Extract Node.js SDK provides APIs for extracting elements and renditions from PDF
142 lines (121 loc) • 3.86 kB
JavaScript
/*
* Copyright 2019 Adobe
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying
* it. If you have received this file from a source other than Adobe,
* then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
const ExecutionContext = require('./execution-context'),
Credentials = require('./auth/credentials'),
ClientConfig = require('./client-config'),
FileRef = require('./io/file-ref'),
ServiceApiError = require('./error/service-api-error'),
ServiceUsageError = require('./error/service-usage-error'),
ExtractPDFOperation = require('./operation/extract-pdf-operation');
const ExtractPDF = {
Operation: ExtractPDFOperation,
SupportedSourceFormat: ExtractPDFOperation.SupportedSourceFormat
},
Error = {
ServiceApiError: ServiceApiError,
ServiceUsageError: ServiceUsageError
},
PDFElementType = {
TEXT : 'text',
TABLES : 'tables',
FIGURES : 'figures'
},
TableStructureType = {
CSV : 'csv'
},
/**
*
* This module is the single entry point for clients to interact with the PDF Tools Extract SDK. This is the only file that
* a 3rd party app should require. All the necessary classes and modules required to
* perform operations via the SDK are exposed through this module.
*
* @module PDFToolsSDK
*
*/
PDFToolsSDK = {
/**
*
* @summary Reference to the {@link Credentials} class.
* @instance
* @memberOf module:PDFToolsSDK
* @type {Credentials}
*
*/
Credentials,
/**
*
* @summary Reference to the {@link ClientConfig} class.
* @instance
* @memberOf module:PDFToolsSDK
* @type {ClientConfig}
*
*/
ClientConfig,
/**
*
* @summary Reference to the {@link ExecutionContext} class.
* @instance
* @memberOf module:PDFToolsSDK
* @type {ExecutionContext}
*
*/
ExecutionContext,
/**
* @summary Reference to the {@link FileRef} class.
* @instance
* @memberOf module:PDFToolsSDK
* @type {FileRef}
*
*/
FileRef,
/**
* @summary Object containing references to classes required for extracting a PDF.
* @instance
* @memberOf module:PDFToolsSDK
* @type {Object}
* @property {ExtractPDFOperation} Operation - Reference to the operation class responsible for extracting a PDF
* @property {ExtractPDFOperation.SupportedSourceFormat} SupportedSourceFormat - Supported file formats whose
* elements can be extracted.
*/
ExtractPDF,
/**
* @summary Object containing supported PDF Element Types for extraction.
* @instance
* @memberOf module:PDFToolsSDK
* @type {Object}
* @property {PDFElementType.TEXT} Text - Textual Data
* @property {PDFElementType.TABLES} Tables - Tabular Data
* @property {PDFElementType.FIGURES} Figures - Image Data
*/
PDFElementType,
/**
* @summary Object containing supported Table Structure Types for extraction.
* @instance
* @memberOf module:PDFToolsSDK
* @type {Object}
* @property {TableStructureType.CSV} CSV - Table data exported as CSV Data
*/
TableStructureType,
/**
* @summary Object containing references to error classes of PDFToolsSDK.
* @memberOf module:PDFToolsSDK
* @instance
* @type {Object}
* @property {ServiceApiError} ServiceApiError - Reference to the ServiceApiError which represents the category
* of errors which are thrown when an underlying service API call results in an error.
* @property {ServiceUsageError} ServiceUsageError - Reference to the ServiceApiError which represents the
* category of errors which are thrown when either service usage limit has been reached or credentials quota
* has been exhausted.
*/
Error,
};
Object.freeze(PDFToolsSDK);
module.exports = PDFToolsSDK;