UNPKG

@pdfme/pdf-lib

Version:

Create and modify PDF files with JavaScript

40 lines 1.25 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const PDFName_1 = __importDefault(require("../objects/PDFName")); const PDFNumber_1 = __importDefault(require("../objects/PDFNumber")); // TODO: Also handle the `/S` and `/D` entries class BorderStyle { constructor(dict) { Object.defineProperty(this, "dict", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.dict = dict; } W() { const W = this.dict.lookup(PDFName_1.default.of('W')); if (W instanceof PDFNumber_1.default) return W; return undefined; } getWidth() { return this.W()?.asNumber() ?? 1; } setWidth(width) { const W = this.dict.context.obj(width); this.dict.set(PDFName_1.default.of('W'), W); } } Object.defineProperty(BorderStyle, "fromDict", { enumerable: true, configurable: true, writable: true, value: (dict) => new BorderStyle(dict) }); exports.default = BorderStyle; //# sourceMappingURL=BorderStyle.js.map