UNPKG

@pdfme/pdf-lib

Version:

Create and modify PDF files with JavaScript

44 lines 1.26 kB
import PDFStream from './PDFStream'; import { arrayAsString } from '../../utils'; class PDFRawStream extends PDFStream { constructor(dict, contents, transform) { super(dict); Object.defineProperty(this, "contents", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "transform", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.contents = contents; this.transform = transform; } asUint8Array() { return this.contents.slice(); } clone(context) { return PDFRawStream.of(this.dict.clone(context), this.contents.slice()); } getContentsString() { return arrayAsString(this.contents); } getContents() { return this.contents; } getContentsSize() { return this.contents.length; } } Object.defineProperty(PDFRawStream, "of", { enumerable: true, configurable: true, writable: true, value: (dict, contents, transform) => new PDFRawStream(dict, contents, transform) }); export default PDFRawStream; //# sourceMappingURL=PDFRawStream.js.map