@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
110 lines • 5.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Encrypt = void 0;
const index_1 = require("./../index");
class Encrypt {
constructor(data) {
let canAssembleDefault = false;
this.canAssemble = typeof (data === null || data === void 0 ? void 0 : data.canAssemble) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canAssemble : canAssembleDefault;
let canExtractContentDefault = false;
this.canExtractContent = typeof (data === null || data === void 0 ? void 0 : data.canExtractContent) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canExtractContent : canExtractContentDefault;
let canExtractForAccessibilityDefault = false;
this.canExtractForAccessibility = typeof (data === null || data === void 0 ? void 0 : data.canExtractForAccessibility) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canExtractForAccessibility : canExtractForAccessibilityDefault;
let canFillInFormDefault = false;
this.canFillInForm = typeof (data === null || data === void 0 ? void 0 : data.canFillInForm) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canFillInForm : canFillInFormDefault;
let canModifyDefault = false;
this.canModify = typeof (data === null || data === void 0 ? void 0 : data.canModify) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canModify : canModifyDefault;
let canModifyAnnotationsDefault = false;
this.canModifyAnnotations = typeof (data === null || data === void 0 ? void 0 : data.canModifyAnnotations) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canModifyAnnotations : canModifyAnnotationsDefault;
let canPrintDefault = false;
this.canPrint = typeof (data === null || data === void 0 ? void 0 : data.canPrint) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canPrint : canPrintDefault;
let canPrintHighResDefault = false;
this.canPrintHighRes = typeof (data === null || data === void 0 ? void 0 : data.canPrintHighRes) !== "undefined" ? data === null || data === void 0 ? void 0 : data.canPrintHighRes : canPrintHighResDefault;
let contentEncryptionDefault = "encryptEverything";
this.contentEncryption = typeof (data === null || data === void 0 ? void 0 : data.contentEncryption) !== "undefined" ? data === null || data === void 0 ? void 0 : data.contentEncryption : contentEncryptionDefault;
this.password = index_1.PasswordEncrypt.fromJson(data === null || data === void 0 ? void 0 : data.password);
}
static getCanAssembleDefault() {
return false;
}
static getCanAssembleDescription() {
return "If \"true,\" the document can be rearranged (e.g., pages can be deleted, inserted, and rotated).";
}
static getCanExtractContentDefault() {
return false;
}
static getCanExtractContentDescription() {
return "If \"true,\" content can be extracted (copied) from the document.";
}
static getCanExtractForAccessibilityDefault() {
return false;
}
static getCanExtractForAccessibilityDescription() {
return "If \"true,\" content can be extracted (copied) for accessibility purposes.";
}
static getCanFillInFormDefault() {
return false;
}
static getCanFillInFormDescription() {
return "If \"true,\" form fields can be filled out and the document can be signed.";
}
static getCanModifyDefault() {
return false;
}
static getCanModifyDescription() {
return "If \"true,\" changes to the document are permitted.";
}
static getCanModifyAnnotationsDefault() {
return false;
}
static getCanModifyAnnotationsDescription() {
return "If \"true,\" comments can be added to the document and deleted from the document.";
}
static getCanPrintDefault() {
return false;
}
static getCanPrintDescription() {
return "If \"true,\" the document can be printed.";
}
static getCanPrintHighResDefault() {
return false;
}
static getCanPrintHighResDescription() {
return "If \"true,\" the document can be printed at high resolution levels.";
}
static getContentEncryptionDefault() {
return "encryptEverything";
}
static getContentEncryptionDescription() {
return "Specifies whether certain contents should be treated differently than others during encryption.\n\n* encryptEverything = All contents of the document are encrypted without distinction (if provided by the standard).\n* exposeMetadata = The document's metadata is left unencrypted to make it discoverable by processing programs. (Has an effect only for 128 bit and 256 bit AES).";
}
static getPasswordDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new Encrypt(data);
}
toJson() {
var _a;
return {
'canAssemble': this.canAssemble,
'canExtractContent': this.canExtractContent,
'canExtractForAccessibility': this.canExtractForAccessibility,
'canFillInForm': this.canFillInForm,
'canModify': this.canModify,
'canModifyAnnotations': this.canModifyAnnotations,
'canPrint': this.canPrint,
'canPrintHighRes': this.canPrintHighRes,
'contentEncryption': this.contentEncryption,
'password': (_a = this.password) === null || _a === void 0 ? void 0 : _a.toJson(),
};
}
clone() {
return Encrypt.fromJson(this.toJson());
}
}
exports.Encrypt = Encrypt;
//# sourceMappingURL=Encrypt.js.map