-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to add content on previous pages in v0.6.x #225
Comments
I've been looking for something like that too. Either that or an event emitted when a new page is created so you can add what you need on creation. However I think an array of pages and a way to target a specific page when doing modifications would work really nicely. |
I will link to this discussion which has already been going on about this topic. That array of pages used to exist, but was removed for performance reasons in v0.5. Basically, it requires buffering all of the content in memory until the end of the document, and for large documents this took up a huge amount of memory. I have seen node processes crash with a couple hundred pages of images because the v8 heap overflowed. It may be possible to add an option, not turned on by default, to bring back this ability. For smallish documents it should work. Also, v0.5+ now also writes image contents to the document right away rather than storing them in memory (images are not part of the main page content stream), so it should be less of an issue now. |
Thanks Devon! Perfectly understandable. On option or callback would be great. |
Would you be interested by a PR? The project I'm working on needs this and it would be a pleasure to dive in the code and try to make it happen. I could go back to 0.4.x but I feel I would be missing out... |
I see it's been a while and no PR has been merged.
So far it has been working without issues. |
People watching this bug may want to check out the above PR I just submitted. |
In the previous versions, before changing to node streams, I was able to go back to previous pages to add elements. These additional elements are calculated as the pages were being produced, allowing the automated pagination to kick in. Then after all pages were generated, those elements would be added. I also used this mechanism to add footer information (like page x out of y). How can this be done in the newest version?
The text was updated successfully, but these errors were encountered: