pdf-lib
Version:
Library for creating and modifying PDF files in JavaScript
26 lines (25 loc) • 1.26 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 __());
};
})();
import { PDFDictionary } from '../pdf-objects';
import { isInstance, validate } from '../../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(dict, isInstance(PDFDictionary), '"dict" must be a PDFDictionary');
return new PDFLinearizationParams(dict.map, dict.index, PDFLinearizationParams.validKeys);
};
return PDFLinearizationParams;
}(PDFDictionary));
export default PDFLinearizationParams;