MCPcopy Index your code
hub / github.com/diegomura/react-pdf / finalize

Method finalize

packages/pdfkit/src/reference.js:69–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 }
68
69 finalize() {
70 this.offset = this.document._offset;
71
72 this.document._write(`${this.id} ${this.gen} obj`);
73 this.document._write(PDFObject.convert(this.data));
74
75 if (this.chunks.length) {
76 this.document._write('stream');
77 for (let chunk of Array.from(this.chunks)) {
78 this.document._write(chunk);
79 }
80
81 this.chunks.length = 0; // free up memory
82 this.document._write('\nendstream');
83 }
84
85 this.document._write('endobj');
86 return this.document._refEnd(this);
87 }
88
89 toString() {
90 return `${this.id} ${this.gen} R`;

Callers 1

endMethod · 0.95

Calls 3

convertMethod · 0.80
_refEndMethod · 0.80
_writeMethod · 0.45

Tested by

no test coverage detected