@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
86 lines • 5.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolboxMergeMerge = void 0;
const index_1 = require("./../index");
class ToolboxMergeMerge {
constructor(data) {
this.data = index_1.MergeFileData.fromJson(data.data);
let modeDefault = "atTheEnd";
this.mode = typeof (data === null || data === void 0 ? void 0 : data.mode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mode : modeDefault;
let outlineNameDefault = "";
this.outlineName = typeof (data === null || data === void 0 ? void 0 : data.outlineName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.outlineName : outlineNameDefault;
let pageDefault = 1;
this.page = typeof (data === null || data === void 0 ? void 0 : data.page) !== "undefined" ? data === null || data === void 0 ? void 0 : data.page : pageDefault;
let removeStaticXFADefault = false;
this.removeStaticXFA = typeof (data === null || data === void 0 ? void 0 : data.removeStaticXFA) !== "undefined" ? data === null || data === void 0 ? void 0 : data.removeStaticXFA : removeStaticXFADefault;
let resetMetadataDefault = false;
this.resetMetadata = typeof (data === null || data === void 0 ? void 0 : data.resetMetadata) !== "undefined" ? data === null || data === void 0 ? void 0 : data.resetMetadata : resetMetadataDefault;
let sourceIsZipDefault = false;
this.sourceIsZip = typeof (data === null || data === void 0 ? void 0 : data.sourceIsZip) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sourceIsZip : sourceIsZipDefault;
}
static getDataDescription() {
return "";
}
static getModeDefault() {
return "atTheEnd";
}
static getModeDescription() {
return "Defines the mode used to merge the PDF documents. The PDF document passed with the \"data\" element will be appended to the current PDF document or inserted at a specific point. The following modes define the position where the documents will be inserted. Instead of a single base document, the \"portfolio\" mode always expects a ZIP archive. The elements in this archive will be added, all with identical permissions, to the resulting portfolio (the data element is not required at all for \"portfolio\").\n\n* atTheEnd = At the end of the PDF document\n* atTheBeginning = At the beginning of the PDF document\n* afterPage = After a page (please refer to the \"page\" attribute) in the PDF document\n* beforePage = Before a page (please refer to the \"page\" attribute) in the PDF document";
}
static getOutlineNameDefault() {
return "";
}
static getOutlineNameDescription() {
return "Used to define the base path that should be used for outline nodes of the source document. This parameter can contain a slash separated path and should ideally end with the name of the document (\"A\/B\/filename\"). If this parameter is not set, all outlines will be appended to the root outline node.";
}
static getPageDefault() {
return 1;
}
static getPageDescription() {
return "Used to define the page number where the PDF document should be inserted.";
}
static getPageMin() {
return 1;
}
static getRemoveStaticXFADefault() {
return false;
}
static getRemoveStaticXFADescription() {
return "If this parameter is enabled, all entries related to static XFA documents and all connected extended permission settings will be removed from the document. Using this parameter it is possible to merge static XFA documents with other documents, which is normally forbidden by default.\n\n**Important:** Although this parameter allows the merging of static XFA documents, this will not create a valid static XFA document as a result. All structures qualifying a document as a static XFA document will be removed. The resulting document will contain a pure Acroform and will not be recognized as a XFA form by applications for XFA creation\/editing. Also, all extended access\n\n* and write permissions will be removed (That normally can expected to be found in a static XFA document).";
}
static getResetMetadataDefault() {
return false;
}
static getResetMetadataDescription() {
return "If you enable this parameter, the source document's metadata will be removed and replaced with default values.";
}
static getSourceIsZipDefault() {
return false;
}
static getSourceIsZipDescription() {
return "If this parameter is enabled, a ZIP archive\n\n* containing the documents to merge - will be expected as the webservice's source document. Also - in that case, the \"data\" parameter is not required. The first element in the ZIP archive will be used as a base document to which all following entries will be appended.\n\n**Important:** The usage of this parameter is expected to be used for the \"portfolio\" mode. All the documents in the ZIP archive will be added to the portfolio receiving identical permission settings.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new ToolboxMergeMerge(data);
}
toJson() {
var _a;
return {
'data': (_a = this.data) === null || _a === void 0 ? void 0 : _a.toJson(),
'mode': this.mode,
'outlineName': this.outlineName,
'page': this.page,
'removeStaticXFA': this.removeStaticXFA,
'resetMetadata': this.resetMetadata,
'sourceIsZip': this.sourceIsZip,
};
}
clone() {
return ToolboxMergeMerge.fromJson(this.toJson());
}
}
exports.ToolboxMergeMerge = ToolboxMergeMerge;
//# sourceMappingURL=ToolboxMergeMerge.js.map