@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
85 lines • 4.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConvertPdfa = void 0;
const index_1 = require("./../index");
class ConvertPdfa {
constructor(data) {
let autoTaggingDefault = false;
this.autoTagging = typeof (data === null || data === void 0 ? void 0 : data.autoTagging) !== "undefined" ? data === null || data === void 0 ? void 0 : data.autoTagging : autoTaggingDefault;
this.errorCorrection = index_1.PdfaErrorCorrection.fromJson(data === null || data === void 0 ? void 0 : data.errorCorrection);
let errorReportDefault = "none";
this.errorReport = typeof (data === null || data === void 0 ? void 0 : data.errorReport) !== "undefined" ? data === null || data === void 0 ? void 0 : data.errorReport : errorReportDefault;
let imageQualityDefault = 75;
this.imageQuality = typeof (data === null || data === void 0 ? void 0 : data.imageQuality) !== "undefined" ? data === null || data === void 0 ? void 0 : data.imageQuality : imageQualityDefault;
let levelDefault = "3b";
this.level = typeof (data === null || data === void 0 ? void 0 : data.level) !== "undefined" ? data === null || data === void 0 ? void 0 : data.level : levelDefault;
let successReportDefault = "none";
this.successReport = typeof (data === null || data === void 0 ? void 0 : data.successReport) !== "undefined" ? data === null || data === void 0 ? void 0 : data.successReport : successReportDefault;
this.zugferd = index_1.Zugferd.fromJson(data === null || data === void 0 ? void 0 : data.zugferd);
}
static getAutoTaggingDefault() {
return false;
}
static getAutoTaggingDescription() {
return "In order to convert a document to conformity levels PDF\/A 1a-3a, the entire document must have appropriate structure information (tags). If auto tagging is enabled, the corresponding structure information (in the form of page tags) will be generated automatically before the actual conversion.";
}
static getErrorCorrectionDescription() {
return "";
}
static getErrorReportDefault() {
return "none";
}
static getErrorReportDescription() {
return "This parameter is used to define whether and in which format the XML report for a failed conversion will be returned.\n\n* none = An XML report will not be returned\n* message = The XML report will be returned as part of the error message\n* file = The XML report will be saved in a file";
}
static getImageQualityDefault() {
return 75;
}
static getImageQualityDescription() {
return "The quality for images which must be transformed during the conversion because they use a compression which is not allowed (e.g. JPX is not allowed in PDF\/A-1) is defined using this parameter. Values in a range from 1 to 100 are allowed whereby a higher value means better quality, but also larger PDF documents.";
}
static getImageQualityMin() {
return 0;
}
static getImageQualityMax() {
return 100;
}
static getLevelDefault() {
return "3b";
}
static getLevelDescription() {
return "Specifies the compliance level when creating or validating PDF\/A documents (as specified in ISO 19005).";
}
static getSuccessReportDefault() {
return "none";
}
static getSuccessReportDescription() {
return "This parameter is used to define whether and in which format the XML report for a successful conversion will be returned.\n\n* none = An XML report will not be returned\n* linked = The XML report will be appended at the end of the PDF\/A document.\n* zip = The PDF\/A document and the XML report will be packaged together in a ZIP archive.\n\n**Tip:** The format of the document generated with \"errorReport\" and \"successReport\" is described by the http:\/\/schema.webpdf.de\/1.0\/report\/pdfa.xsd schema.";
}
static getZugferdDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new ConvertPdfa(data);
}
toJson() {
var _a, _b;
return {
'autoTagging': this.autoTagging,
'errorCorrection': (_a = this.errorCorrection) === null || _a === void 0 ? void 0 : _a.toJson(),
'errorReport': this.errorReport,
'imageQuality': this.imageQuality,
'level': this.level,
'successReport': this.successReport,
'zugferd': (_b = this.zugferd) === null || _b === void 0 ? void 0 : _b.toJson(),
};
}
clone() {
return ConvertPdfa.fromJson(this.toJson());
}
}
exports.ConvertPdfa = ConvertPdfa;
//# sourceMappingURL=ConvertPdfa.js.map