UNPKG

@adobe/pdfservices-node-sdk

Version:

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

77 lines 3.28 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.FieldOptions = void 0; const ValidationUtil_1 = require("../../../internal/util/ValidationUtil"); /** * Parameters specifying options related to the seal field required for {@link PDFElectronicSealParams}. */ class FieldOptions { /** * Constructs a `FieldOptions` instance. * * @param params - The parameters for constructing an instance of `FieldOptions`. * @param [params.visible] - The intended visibility flag for the electronic seal. Default value is `true`. * @param [params.location] - A {@link FieldLocation} instance specifying coordinates for the electronic seal. * The location is only required for visible signatures if the signature field does not already exist in the * PDF document. If location is provided along with the existing signature field then it is ignored. * @param params.fieldName - The name of the field to be used for applying the electronic seal. * If signature field with this field name already exist, that field will be used. * If it does not exist, a signature field with this field name will be created. Cannot be undefined. * @param [params.pageNumber] - The page number to which the signature field should be attached. * Page numbers are 1-based. The page number is only required for visible signatures if the signature field * does not already exist in the PDF document. If page number is provided along with the existing signature * field then the page number should be same on which signature field is present in the document, * else an error is thrown. */ constructor(params) { ValidationUtil_1.ValidationUtil.validateFieldOptions(params); this._fieldLocation = params.location; this._pageNumber = params.pageNumber; this._fieldName = params.fieldName; this._visible = params.visible; } /** * Returns the name of the field to be used for applying the electronic seal. * * @returns the field name for the electronic seal. */ get fieldName() { return this._fieldName; } /** * Returns the intended visibility flag for the electronic seal. * * @returns the visibility flag for the electronic seal. */ get visible() { return this._visible; } /** * Returns the intended page number for the electronic seal. * * @returns the page number for the electronic seal. */ get pageNumber() { return this._pageNumber; } /** * Returns a {@link FieldLocation} instance specifying coordinates for the electronic seal. * * @returns the seal field location coordinates. */ get fieldLocation() { return this._fieldLocation; } } exports.FieldOptions = FieldOptions; //# sourceMappingURL=FieldOptions.js.map