@adobe/pdftools-extract-node-sdk
Version:
The Document Services PDF Tools Extract Node.js SDK provides APIs for extracting elements and renditions from PDF
35 lines (28 loc) • 1.27 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 CpfOperationService = require('./cpf-operation-service'),
cpfConfig = require('../config/cpf-engine-config.js'),
CPFMessage = require('./../cpf/cpf-message'),
CpfDocument = require('../cpf/request/platform/cpf-document.js');
class ExtractPdfService extends CpfOperationService {
constructor() {
super();
}
getCPFMessage(operationMessage) {
let outputInfo = new CpfDocument('application/json','cid:jsonoutpart'),
outputRenditions = new CpfDocument("text/directory","cid:fileoutpart"),
params = (operationMessage.options) ? Object.assign({}, operationMessage.options) : {},
inputDocuments = new CpfDocument(operationMessage.sourceFileRefs.input.mediaType,'file0'),
files = [operationMessage.sourceFileRefs];
return new CPFMessage(inputDocuments, outputInfo, outputRenditions, params, files, cpfConfig.extractPdf);
}
}
module.exports = ExtractPdfService;