@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
94 lines • 7.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConverterMail = void 0;
class ConverterMail {
constructor(data) {
let adjustFontsDefault = false;
this.adjustFonts = typeof (data === null || data === void 0 ? void 0 : data.adjustFonts) !== "undefined" ? data === null || data === void 0 ? void 0 : data.adjustFonts : adjustFontsDefault;
let attachmentModeDefault = "embed";
this.attachmentMode = typeof (data === null || data === void 0 ? void 0 : data.attachmentMode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.attachmentMode : attachmentModeDefault;
let downloadImagesDefault = false;
this.downloadImages = typeof (data === null || data === void 0 ? void 0 : data.downloadImages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.downloadImages : downloadImagesDefault;
let ignoreMissingBodyChunkDefault = false;
this.ignoreMissingBodyChunk = typeof (data === null || data === void 0 ? void 0 : data.ignoreMissingBodyChunk) !== "undefined" ? data === null || data === void 0 ? void 0 : data.ignoreMissingBodyChunk : ignoreMissingBodyChunkDefault;
let reduceImageSizeDefault = false;
this.reduceImageSize = typeof (data === null || data === void 0 ? void 0 : data.reduceImageSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.reduceImageSize : reduceImageSizeDefault;
let resizeImagesDefault = false;
this.resizeImages = typeof (data === null || data === void 0 ? void 0 : data.resizeImages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.resizeImages : resizeImagesDefault;
let resizeTablesDefault = false;
this.resizeTables = typeof (data === null || data === void 0 ? void 0 : data.resizeTables) !== "undefined" ? data === null || data === void 0 ? void 0 : data.resizeTables : resizeTablesDefault;
let useBackgroundDefault = true;
this.useBackground = typeof (data === null || data === void 0 ? void 0 : data.useBackground) !== "undefined" ? data === null || data === void 0 ? void 0 : data.useBackground : useBackgroundDefault;
}
static getAdjustFontsDefault() {
return false;
}
static getAdjustFontsDescription() {
return "If \"true\", then the font specifications \"Arial\", \"Helvetica\" and \"Sans-Serif\" in HTML documents and e-mails (which are based on HTML) are automatically replaced by the \"Arial Unicode MS\" font. The improves the appearance of the typeface in the PDF result.";
}
static getAttachmentModeDefault() {
return "embed";
}
static getAttachmentModeDescription() {
return "Specifies the manner in which attachments are to be processed in e-mails.\n\n* embed = Embed in original format\n* remove = Remove attachments\n* convert = Converts the attachments to PDF format and embeds them as an attachment\n* convertMerge = Converts the attachments to PDF format and appends them as additional page(s) at the end\n\n**Important:** If conversion to PDF format is not possible when using \"convert\" or \"convertMerge\", the attachment will be embedded in its original format.";
}
static getDownloadImagesDefault() {
return false;
}
static getDownloadImagesDescription() {
return "If \"true\", then externally referenced images in the HTML content of the e-mail are downloaded and inserted into the document. If false, the images are not downloaded and the external references to the image are removed, leaving already embedded images intact. This option can slow down the conversion if many images are included or if, for example, e-mail documents are converted in which the images can no longer be retrieved.";
}
static getIgnoreMissingBodyChunkDefault() {
return false;
}
static getIgnoreMissingBodyChunkDescription() {
return "If this option is enabled, an error will not be triggered (the conversion will not be aborted) for e-mails if there is no body element in the file structure. However, this should not be confused with an e-mail not having any content.";
}
static getReduceImageSizeDefault() {
return false;
}
static getReduceImageSizeDescription() {
return "If \"true\", then all images are reduced in their pixel size so that they fit into the maximum page width. This only applies to images that have been resized using the `resizeImages` option. These images are reduced to the maximum number of pixels required to fit the page width. Images that are not affected by the `resizeImages` option are not resized.\n\n**Important:** If you activate the `reduceImageSize` option, you must also activate `resizeImages` and only resized images will be affected by this option. This option also leads to a significant reduction in the number of pixels in images, which can lead to an improved document size.";
}
static getResizeImagesDefault() {
return false;
}
static getResizeImagesDescription() {
return "If true, then an attempt is made to fit all images that are not in a table to the maximum page width in the PDF document. The graphics will be scaled (while maintaining the aspect ratio) to fit the width of the page and not be cut off. Please note that this may cause the original formatting of the email to be lost or to deviate from the original due to the scaling.\n\n**Important:** If the \"resizeImages\" option is enabled, you must expect that the original appearance of the e-mail document will no longer be preserved.";
}
static getResizeTablesDefault() {
return false;
}
static getResizeTablesDescription() {
return "If true, then an attempt is made to fit all tables to the maximum page width in the PDF document. An attempt is made to reduce the individual columns of a table so that the table fits completely within the page width. This works only for simple tables originally defined with dynamic sizes and not for nested tables (table-in-table). Please note that this may cause the original formatting of the email to be lost or to deviate from the original due to scaling.\n\n**Important:** If the option \"resizeTables\" is activated, you must expect that the original appearance of the e-mail document is no longer preserved. The recalculation of the table columns may also result in very narrow columns in the output.";
}
static getUseBackgroundDefault() {
return true;
}
static getUseBackgroundDescription() {
return "If \"true\", then a background defined in the e-mail (in the HTML content) is also output in the PDF document. If \"false\", the background will be hidden.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new ConverterMail(data);
}
toJson() {
return {
'adjustFonts': this.adjustFonts,
'attachmentMode': this.attachmentMode,
'downloadImages': this.downloadImages,
'ignoreMissingBodyChunk': this.ignoreMissingBodyChunk,
'reduceImageSize': this.reduceImageSize,
'resizeImages': this.resizeImages,
'resizeTables': this.resizeTables,
'useBackground': this.useBackground,
};
}
clone() {
return ConverterMail.fromJson(this.toJson());
}
}
exports.ConverterMail = ConverterMail;
//# sourceMappingURL=ConverterMail.js.map