Skip to content
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

Handle large campaign generation #982

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Falinor
Copy link
Collaborator

@Falinor Falinor commented Oct 24, 2024

Given a draft and a lot of housings :
Open a browser and render the HTML content using puppeteer.
The images are extracted from the HTML and saved for later.
The images are hidden in the HTML to avoid rendering them in the PDF.
Transform HTML to PDF and return the result as a PDFDocument.
Clean up the browser.
Merge the pages into a single PDF.
For each image, embed it in the PDF and reference it on each page at its correct position.
Save the final PDF.

Features

  • Handles JPEG and PNG
  • Handles variable positions for instance when there are one or more logo
  • Avoids copying the same images over and over. Embed them once, reference them later
  • Handles huge quantities using Node Streams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant