UNPKG

pdfkit

Version:

A PDF generation library for Node.js

38 lines (28 loc) 829 B
(function() { var Table; Table = (function() { function Table(file, tag) { var info, _ref; this.file = file; this.tag = tag; if ((_ref = this.tag) == null) { this.tag = this.constructor.name.replace('Table', '').toLowerCase(); } info = this.file.directory.tables[this.tag]; this.exists = !!info; if (info) { this.offset = info.offset, this.length = info.length; this.parse(this.file.contents); } } Table.prototype.parse = function() {}; Table.prototype.encode = function() {}; Table.prototype.raw = function() { if (!this.exists) return null; this.file.contents.pos = this.offset; return this.file.contents.read(this.length); }; return Table; })(); module.exports = Table; }).call(this);