Skip to content

Instantly share code, notes, and snippets.

@Brunomachadob
Last active March 2, 2019 21:36
Show Gist options
  • Save Brunomachadob/0e1f2cb79693a1b4bdcabaa470e88ff7 to your computer and use it in GitHub Desktop.
Save Brunomachadob/0e1f2cb79693a1b4bdcabaa470e88ff7 to your computer and use it in GitHub Desktop.
PDF creators comparison

Research about pdf creation

How to create a PDF file with 15.000 pages, preferably with a Stream as an input and output, to prevent memory issues.

Name Stream Complexity (1-5) Time (s) Memory (mb) O.P. (mb)
pdfmake N 2 Infinite 500 None
pdfkit Y 5 10 300 None
pdfjs Y 3 18 700 None
wkhtmltopdf N HTML 83 100 300
puppeeter N HTML 44 190 300

Infinite: Didn't finish.

As my tests indicates, pdfkit and pdfjs could probably consume the memory up to the limit without blowing up, maybe because of the Stream backpressure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment