UNPKG

@adobe/pdfservices-node-sdk

Version:

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

87 lines 3.54 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.ProtectPDFParams = void 0; const ValidationUtil_1 = require("../../../internal/util/ValidationUtil"); /** * Parameters for securing PDF file with passwords and document permissions using {@link ProtectPDFJob}. */ class ProtectPDFParams { /** * Constructs a new `ProtectPDFParams` instance. * * @param params - The parameters for constructing a `ProtectPDFParams` instance. * @param [params.userPassword] - The user password required for opening the encrypted PDF file. * Allowed maximum length for the user password is 128 characters. * @param [params.ownerPassword] - The owner password required to control access permissions in the * encrypted PDF file. This password can also be used to open/view the encrypted PDF file. Allowed maximum length * for the user password is 128 characters. * @param params.encryptionAlgorithm The encryption algorithm required for encrypting the PDF file. * For AES-128 encryption, the password supports LATIN-I characters only. For AES-256 encryption, passwords * supports Unicode character set. Cannot be undefined. * @param [params.contentEncryption] The type of content to encrypt in the PDF file. Default value is * {@link ContentEncryption#ALL_CONTENT ALL_CONTENT}. * @param [params.permissions] The permissions for the encrypted PDF file. This includes permissions to * allow printing, editing and content copying in the PDF document. Permissions can only be used in case the * owner password is set. */ constructor(params) { ValidationUtil_1.ValidationUtil.validateProtectPDFParams(params); this._encryptionAlgorithm = params.encryptionAlgorithm; this._ownerPassword = params.ownerPassword; this._userPassword = params.userPassword; this._contentEncryption = params.contentEncryption; this._permissions = params.permissions; } /** * Returns the user password of the resulting encrypted PDF file. * * @returns the user password */ get userPassword() { return this._userPassword; } /** * Returns the owner password of the resulting encrypted PDF file. * * @returns the owner password. */ get ownerPassword() { return this._ownerPassword; } /** * Returns the {@link EncryptionAlgorithm} of the resulting encrypted PDF file. * * @returns the encryption algorithm. */ get encryptionAlgorithm() { return this._encryptionAlgorithm; } /** * Returns the type of {@link ContentEncryption} for the resulting encrypted PDF file. * * @returns the type of content to encrypt. */ get contentEncryption() { return this._contentEncryption; } /** * Returns the document {@link Permissions} for the resulting encrypted PDF file. * * @returns the document permissions. */ get permissions() { return this._permissions; } } exports.ProtectPDFParams = ProtectPDFParams; //# sourceMappingURL=ProtectPDFParams.js.map