pdf-lib
Version:
Library for creating and modifying PDF files in JavaScript
28 lines (27 loc) • 1.38 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var pdf_objects_1 = require("../pdf-objects");
var validate_1 = require("../../utils/validate");
var PDFLinearizationParams = /** @class */ (function (_super) {
__extends(PDFLinearizationParams, _super);
function PDFLinearizationParams() {
return _super !== null && _super.apply(this, arguments) || this;
}
PDFLinearizationParams.validKeys = Object.freeze(['L', 'H', 'O', 'E', 'N', 'T', 'P']);
PDFLinearizationParams.fromDict = function (dict) {
validate_1.validate(dict, validate_1.isInstance(pdf_objects_1.PDFDictionary), '"dict" must be a PDFDictionary');
return new PDFLinearizationParams(dict.map, dict.index, PDFLinearizationParams.validKeys);
};
return PDFLinearizationParams;
}(pdf_objects_1.PDFDictionary));
exports.default = PDFLinearizationParams;
;