UNPKG

@adobe/pdftools-extract-node-sdk

Version:

The Document Services PDF Tools Extract Node.js SDK provides APIs for extracting elements and renditions from PDF

40 lines (36 loc) 1.08 kB
/* * 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 _ = require('lodash-core'); class Engine{ constructor(inputDocument, params, outputDocument){ let inputKey = 'documentIn'; if(Array.isArray(inputDocument)){ inputKey = 'documentsIn'; } this['sensei:inputs'] = {}; this['sensei:inputs'][inputKey] = inputDocument; this['sensei:params'] = _.cloneDeep(params); this['sensei:outputs'] = {'documentOut': outputDocument}; } set executionInfo(executionInfo){ this['sensei:executionInfo'] = executionInfo; } set inputs(inputs){ this['sensei:inputs'] = inputs; } set params(params){ this['sensei:params'] = Object.assign({},params); } set outputs(outputs){ this['sensei:outputs'] = outputs; } } module.exports = Engine;