hummusRecipe | A powerful PDF tool for NodeJS based on HummusJS | Document Editor library
kandi X-RAY | hummusRecipe Summary
kandi X-RAY | hummusRecipe Summary
A powerful PDF tool for NodeJS based on HummusJS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Make text boxes
- Initializes the column options .
- Parses attributes .
- Draw an arc
- Convert a color model to an array of colors
- Prepare text to be centered on the right .
- Draws a rounded rectangle
- Tints the given color
- Creates a polygon
- Make a line object text object
hummusRecipe Key Features
hummusRecipe Examples and Code Snippets
Community Discussions
Trending Discussions on hummusRecipe
QUESTION
I'm trying to make a simple mail-merge where recipients information is inserted on top of a template pdf.
The template is 1 page, but the result can be up to several hundred pages.
I have all recipient in array objects, but need to find a way to loop over that and create a unique page for each recipient.
I'm not sure if hummus-recipe is the right tool, so would greatly appreciate any input as to how to do this.
My demo looks like this
...ANSWER
Answered 2019-Nov-13 at 09:08After conversing with the creator of hummus-recipe and others, the solution became somewhat obvious. Its not possible to append a page and then modify it, and its not possible to modify the same page several times.
The solution then is to make the final pdf in two passes. First create a masterPdf where the template is appended in a for loop, save this file and then edit each of those pages.
I have created a working code as shown below. I have made the functions async as I need to run it on lambda an need som control over returns etc. Also this way its possible to save both the tmp-file and final pdf on AWS S3.
The code below takes about 60 seconds to create a 200 page pdf from a 1,6mb template. Any ideas for optimizations will be greatly appreciated.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hummusRecipe
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page