UNPKG

@adobe/pdfservices-node-sdk

Version:

The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.

67 lines 2.7 kB
"use strict"; /* * Copyright 2024 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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentMergeParams = void 0; const ValidationUtil_1 = require("../../../internal/util/ValidationUtil"); /** * Parameters for document generation using {@link DocumentMergeJob}. */ class DocumentMergeParams { /** * Constructs a new `DocumentMergeParams` instance. * * @param params - The parameters for constructing an instance of `DocumentMergeParams`. * @param params.jsonDataForMerge - The JSON data to be used for merging. Cannot be undefined. * @param [params.fragments] - The Fragments JSON object or a JSON array to resolve fragments in the document * template. To know more about fragments use-case in document generation and document templates, * please see the {@link http://www.adobe.com/go/dcdocgen_fragments_support documentation}. * @param [params.outputFormat] - The target format of the generated output document. * The default value is {@link OutputFormat#PDF PDF}. */ constructor(params) { ValidationUtil_1.ValidationUtil.validateDocumentMergeParams(params); this._jsonDataForMerge = JSON.parse(JSON.stringify(params.jsonDataForMerge)); if (params.fragments) { this._fragments = []; params.fragments.forEach((fragment) => { this._fragments.push(JSON.parse(JSON.stringify(fragment))); }); } this._outputFormat = params.outputFormat; } /** * Represents the input datasource for the document merge process as a JSON object * * @returns the input JSON Data to be merged with document template */ get jsonDataForMerge() { return this._jsonDataForMerge; } /** * Returns the Fragments JSON object or a JSON array to resolve fragments in the document template. * * @returns the fragments to be used for merging. */ get fragments() { return this._fragments; } /** * Returns the intended {@link OutputFormat} of the generated document. * * @returns the {@link OutputFormat} of the generated document. */ get outputFormat() { return this._outputFormat; } } exports.DocumentMergeParams = DocumentMergeParams; //# sourceMappingURL=DocumentMergeParams.js.map