UNPKG

@pdfme/pdf-lib

Version:

Create and modify PDF files with JavaScript

44 lines 1.51 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const CharCodes_1 = __importDefault(require("../syntax/CharCodes")); class PDFTrailerDict { constructor(dict) { Object.defineProperty(this, "dict", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.dict = dict; } toString() { return `trailer\n${this.dict.toString()}`; } sizeInBytes() { return 8 + this.dict.sizeInBytes(); } copyBytesInto(buffer, offset) { const initialOffset = offset; buffer[offset++] = CharCodes_1.default.t; buffer[offset++] = CharCodes_1.default.r; buffer[offset++] = CharCodes_1.default.a; buffer[offset++] = CharCodes_1.default.i; buffer[offset++] = CharCodes_1.default.l; buffer[offset++] = CharCodes_1.default.e; buffer[offset++] = CharCodes_1.default.r; buffer[offset++] = CharCodes_1.default.Newline; offset += this.dict.copyBytesInto(buffer, offset); return offset - initialOffset; } } Object.defineProperty(PDFTrailerDict, "of", { enumerable: true, configurable: true, writable: true, value: (dict) => new PDFTrailerDict(dict) }); exports.default = PDFTrailerDict; //# sourceMappingURL=PDFTrailerDict.js.map