@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
68 lines • 3.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormDocument = void 0;
const index_1 = require("./../index");
class FormDocument {
constructor(data) {
let defaultAppearanceDefault = "";
this.defaultAppearance = typeof (data === null || data === void 0 ? void 0 : data.defaultAppearance) !== "undefined" ? data === null || data === void 0 ? void 0 : data.defaultAppearance : defaultAppearanceDefault;
this.field = (data.field || []).map(index_1.Field.fromJson);
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 needAppearancesDefault = false;
this.needAppearances = typeof (data === null || data === void 0 ? void 0 : data.needAppearances) !== "undefined" ? data === null || data === void 0 ? void 0 : data.needAppearances : needAppearancesDefault;
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;
}
static getDefaultAppearanceDefault() {
return "";
}
static getDefaultAppearanceDescription() {
return "If present, this contains the default appearance of the form's fields. This shall be a string containing graphics and text state operators for example defining text colors, sizes etc.";
}
static getFieldDefault() {
return [];
}
static getFieldDescription() {
return "";
}
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 getNeedAppearancesDefault() {
return false;
}
static getNeedAppearancesDescription() {
return "When set to \"true\" the displaying Application shall generate appearances for all widgets defining the document's form.";
}
static getObjectKeyDefault() {
return "";
}
static getObjectKeyDescription() {
return "The object ID of the form.\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 fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new FormDocument(data);
}
toJson() {
var _a;
return {
'defaultAppearance': this.defaultAppearance,
'field': (_a = this.field) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()),
'formType': this.formType,
'needAppearances': this.needAppearances,
'objectKey': this.objectKey,
};
}
clone() {
return FormDocument.fromJson(this.toJson());
}
}
exports.FormDocument = FormDocument;
//# sourceMappingURL=FormDocument.js.map