mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Fix links to page numbers within the document
This commit is contained in:
parent
1f5565d087
commit
c17bf39710
@ -4,6 +4,7 @@
|
||||
|
||||
- Fix setting printing permission
|
||||
- Fix corruption of string objects in browser
|
||||
- Fix links to pages within the document
|
||||
- Add option to set default font
|
||||
- Remove call to fontkit.openSync
|
||||
- Add standalone virtual file system implementation
|
||||
|
||||
@ -60,22 +60,6 @@ class PDFDocument extends stream.Readable {
|
||||
Kids: []
|
||||
});
|
||||
|
||||
Pages.finalize = function() {
|
||||
this.offset = this.document._offset;
|
||||
this.document._write(this.id + ' ' + this.gen + ' obj');
|
||||
this.document._write('<<');
|
||||
this.document._write('/Type /Pages');
|
||||
this.document._write(`/Count ${this.data.Count}`);
|
||||
this.document._write(
|
||||
`/Kids [${Buffer.concat(this.data.Kids)
|
||||
.slice(0, -1)
|
||||
.toString()}]`
|
||||
);
|
||||
this.document._write('>>');
|
||||
this.document._write('endobj');
|
||||
return this.document._refEnd(this);
|
||||
};
|
||||
|
||||
this._root = this.ref({
|
||||
Type: 'Catalog',
|
||||
Pages
|
||||
@ -140,7 +124,7 @@ class PDFDocument extends stream.Readable {
|
||||
|
||||
// add the page to the object store
|
||||
const pages = this._root.data.Pages.data;
|
||||
pages.Kids.push(new Buffer(this.page.dictionary + ' '));
|
||||
pages.Kids.push(this.page.dictionary);
|
||||
pages.Count++;
|
||||
|
||||
// reset x and y coordinates
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user