@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
198 lines • 11.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetadataInformation = void 0;
const index_1 = require("./../index");
class MetadataInformation {
constructor(data) {
let attachmentsDefault = 0;
this.attachments = typeof (data === null || data === void 0 ? void 0 : data.attachments) !== "undefined" ? data === null || data === void 0 ? void 0 : data.attachments : attachmentsDefault;
this.description = index_1.Description.fromJson(data.description);
let docMDPDefault = "none";
this.docMDP = typeof (data === null || data === void 0 ? void 0 : data.docMDP) !== "undefined" ? data === null || data === void 0 ? void 0 : data.docMDP : docMDPDefault;
let encryptedDefault = false;
this.encrypted = typeof (data === null || data === void 0 ? void 0 : data.encrypted) !== "undefined" ? data === null || data === void 0 ? void 0 : data.encrypted : encryptedDefault;
let fileSizeDefault = 0;
this.fileSize = typeof (data === null || data === void 0 ? void 0 : data.fileSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileSize : fileSizeDefault;
let formTypeDefault = "none";
this.formType = typeof (data === null || data === void 0 ? void 0 : data.formType) !== "undefined" ? data === null || data === void 0 ? void 0 : data.formType : formTypeDefault;
let initialPageDefault = 1;
this.initialPage = typeof (data === null || data === void 0 ? void 0 : data.initialPage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.initialPage : initialPageDefault;
let initialViewDefault = "none";
this.initialView = typeof (data === null || data === void 0 ? void 0 : data.initialView) !== "undefined" ? data === null || data === void 0 ? void 0 : data.initialView : initialViewDefault;
let languageDefault = "";
this.language = typeof (data === null || data === void 0 ? void 0 : data.language) !== "undefined" ? data === null || data === void 0 ? void 0 : data.language : languageDefault;
let magnificationDefault = "fitVisible";
this.magnification = typeof (data === null || data === void 0 ? void 0 : data.magnification) !== "undefined" ? data === null || data === void 0 ? void 0 : data.magnification : magnificationDefault;
let magnificationZoomDefault = 100;
this.magnificationZoom = typeof (data === null || data === void 0 ? void 0 : data.magnificationZoom) !== "undefined" ? data === null || data === void 0 ? void 0 : data.magnificationZoom : magnificationZoomDefault;
let objectKeyDefault = "";
this.objectKey = typeof (data === null || data === void 0 ? void 0 : data.objectKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.objectKey : objectKeyDefault;
let pageLayoutDefault = "singlePage";
this.pageLayout = typeof (data === null || data === void 0 ? void 0 : data.pageLayout) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pageLayout : pageLayoutDefault;
let pagesDefault = 0;
this.pages = typeof (data === null || data === void 0 ? void 0 : data.pages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pages : pagesDefault;
this.pdfa = index_1.MetadataPdfa.fromJson(data.pdfa);
let portfolioDefault = false;
this.portfolio = typeof (data === null || data === void 0 ? void 0 : data.portfolio) !== "undefined" ? data === null || data === void 0 ? void 0 : data.portfolio : portfolioDefault;
let signaturesDefault = 0;
this.signatures = typeof (data === null || data === void 0 ? void 0 : data.signatures) !== "undefined" ? data === null || data === void 0 ? void 0 : data.signatures : signaturesDefault;
let versionDefault = "";
this.version = typeof (data === null || data === void 0 ? void 0 : data.version) !== "undefined" ? data === null || data === void 0 ? void 0 : data.version : versionDefault;
this.viewerPreferences = index_1.MetadataViewerPreferences.fromJson(data.viewerPreferences);
}
static getAttachmentsDefault() {
return 0;
}
static getAttachmentsDescription() {
return "The number of attachments contained in the document.";
}
static getAttachmentsMin() {
return 0;
}
static getDescriptionDescription() {
return "";
}
static getDocMDPDefault() {
return "none";
}
static getDocMDPDescription() {
return "A document \"Modification Detection and Prevention\" may be set, that defines which modifications of the document are allowed and which modifications would render the signature invalid.\n\n* none = The document is unprotected - modify it as you please.\n* noChangesAllowed = Any modifications of the document would render the signatures invalid.\n* formFillingSignatures = You may fill in forms and further sign the document.\n* formFillingSignaturesAndAnnotations = Form filling, signing and adding annotations are allowed.";
}
static getEncryptedDefault() {
return false;
}
static getEncryptedDescription() {
return "This will be set to \"true\" for a document, that is either password protected or certificate encrypted.";
}
static getFileSizeDefault() {
return 0;
}
static getFileSizeDescription() {
return "The byte size of the document.";
}
static getFileSizeMin() {
return 0;
}
static getFileSizeMax() {
return 9223372036854775807;
}
static getFormTypeDefault() {
return "none";
}
static getFormTypeDescription() {
return "When set to another value than \"none\", the document does contain a PDF form in the hereby given format.\n\n* none = The document does not contain a form.\n* acroForm = The document contains a standard PDF Acroform.\n* staticXFA = The document contains a \"XML Forms Architecture\" form with a fixed layout (static).\n* dynamicXFA = The document contains a \"XML Forms Architecture\" form with an adaptable\/interactive layout (dynamic).";
}
static getInitialPageDefault() {
return 1;
}
static getInitialPageDescription() {
return "The first page, that shall be displayed when opening the document in a PDF Reader.";
}
static getInitialViewDefault() {
return "none";
}
static getInitialViewDescription() {
return "Defines which sub-windows will be opened when the PDF document is opened.\n\n* none = No special view\n* outlines = Opens the \"Bookmarks\" tab\n* thumbnails = Opens the \"Thumbnails\" tab\n* fullscreen = Opens the document in full screen mode";
}
static getLanguageDefault() {
return "";
}
static getLanguageDescription() {
return "The natural language of the document. This could either contain the language name or a language tag.";
}
static getMagnificationDefault() {
return "fitVisible";
}
static getMagnificationDescription() {
return "The initial page zoom settings of a document. When opening the document in a Reader, this zoom settings shall be used.\n\n* none = Uses the application's default view.\n* fitWidth = Page width.\n* fitPage = Page dimensions.\n* fitHeight = Page height.\n* fitVisible = Page content width.\n* fitActual = Uses the original page dimensions (100% zoom factor).\n* zoom = Sets an explicit magnification value.";
}
static getMagnificationZoomDefault() {
return 100;
}
static getMagnificationZoomDescription() {
return "If a magnification \"zoom\" is selected for this document, this is the actual percentage the pages of the document shall be zoomed to, when opening the document in a PDF Reader.";
}
static getMagnificationZoomMin() {
return 0;
}
static getObjectKeyDefault() {
return "";
}
static getObjectKeyDescription() {
return "The object ID of the document's catalog. (root)\n\n**Info:** A PDF object ID consists of two numbers, where the first number selects the object's number and the second the \"generation\" of the object. The object ID shall always be unique within the context of the document and can be used to select a specific object.";
}
static getPageLayoutDefault() {
return "singlePage";
}
static getPageLayoutDescription() {
return "The set initial page layout of a document. When opening the document in a Reader, this layout shall be selected to display pages.\n\n* singlePage = One page at a time.\n* oneColumn = One continuous column of pages.\n* twoColumnLeft = The pages in two columns, with odd-numbered pages on the left.\n* twoColumnRight = The pages in two columns, with odd-numbered pages on the right.\n* twoPageLeft = Display the pages two at a time, with odd-numbered pages on the left.\n* twoPageRight = Display the pages two at a time, with odd-numbered pages on the right.";
}
static getPagesDefault() {
return 0;
}
static getPagesDescription() {
return "The number of pages contained in the document.";
}
static getPagesMin() {
return 0;
}
static getPdfaDescription() {
return "";
}
static getPortfolioDefault() {
return false;
}
static getPortfolioDescription() {
return "Will be set to \"true\" for a \"PDF collection\" (Portfolio), that serves as the container for other documents.";
}
static getSignaturesDefault() {
return 0;
}
static getSignaturesDescription() {
return "The number of signatures contained in the document.";
}
static getVersionDefault() {
return "";
}
static getVersionDescription() {
return "The version name of the PDF standard the document claims compatibility with.";
}
static getViewerPreferencesDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new MetadataInformation(data);
}
toJson() {
var _a, _b, _c;
return {
'attachments': this.attachments,
'description': (_a = this.description) === null || _a === void 0 ? void 0 : _a.toJson(),
'docMDP': this.docMDP,
'encrypted': this.encrypted,
'fileSize': this.fileSize,
'formType': this.formType,
'initialPage': this.initialPage,
'initialView': this.initialView,
'language': this.language,
'magnification': this.magnification,
'magnificationZoom': this.magnificationZoom,
'objectKey': this.objectKey,
'pageLayout': this.pageLayout,
'pages': this.pages,
'pdfa': (_b = this.pdfa) === null || _b === void 0 ? void 0 : _b.toJson(),
'portfolio': this.portfolio,
'signatures': this.signatures,
'version': this.version,
'viewerPreferences': (_c = this.viewerPreferences) === null || _c === void 0 ? void 0 : _c.toJson(),
};
}
clone() {
return MetadataInformation.fromJson(this.toJson());
}
}
exports.MetadataInformation = MetadataInformation;
//# sourceMappingURL=MetadataInformation.js.map