TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to generate PDFs from the back end?

12 pointsby michidkabout 2 years ago
Ask HN: How to generate PDFs (certificates/invoices) from the backend? Can you recommend a easy to integrate service?

17 comments

qwabout 2 years ago
I recently found out that a Norwegian government agency open sourced a micro service for generating PDF<p>I haven&#x27;t used it, but it looks promising. You create templates based on html (Handlebars templates), which should make it easy to get started.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;navikt&#x2F;pdfgen">https:&#x2F;&#x2F;github.com&#x2F;navikt&#x2F;pdfgen</a><p>It may be worth a look
jeilersabout 2 years ago
We are using z3c.rml (<a href="https:&#x2F;&#x2F;github.com&#x2F;zopefoundation&#x2F;z3c.rml">https:&#x2F;&#x2F;github.com&#x2F;zopefoundation&#x2F;z3c.rml</a>) based on ReportLab. Layout is written in HTML-like XML and render performance is pretty good.
评论 #35847777 未加载
bguebertabout 2 years ago
We use PDFlib, but we started using it a long time ago when there wasn&#x27;t a lot of good open source options for building pdfs. PDFlib isn&#x27;t open source or free. So far PDFlib has worked well and not been so expensive that we&#x27;ve needed to look for anything else.<p><a href="https:&#x2F;&#x2F;www.pdflib.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.pdflib.com&#x2F;</a>
Leokoabout 2 years ago
Generating PDFs is a pain with most libraries, especially if the content is dynamic and should span multiple pages.<p>If you can use NodeJS on your backend, you might want to take a look at my PDF Library: <a href="https:&#x2F;&#x2F;github.com&#x2F;DevLeoko&#x2F;painless-pdf">https:&#x2F;&#x2F;github.com&#x2F;DevLeoko&#x2F;painless-pdf</a>
brudgersabout 2 years ago
On the command line, pdftk.<p>If you are using Linux, it is probably a package in your distro.<p><a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pdftk" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pdftk</a><p>The homepage for the free (server) version.<p><a href="https:&#x2F;&#x2F;www.pdflabs.com&#x2F;tools&#x2F;pdftk-server&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.pdflabs.com&#x2F;tools&#x2F;pdftk-server&#x2F;</a>
评论 #35843407 未加载
bombcarabout 2 years ago
What do you want to do? I&#x27;ve done some crude ones by having a program dump values into a LaTeX template that I then ran through pdflatex.
评论 #35839652 未加载
mkranjecabout 2 years ago
ReactPDF (<a href="https:&#x2F;&#x2F;react-pdf.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;react-pdf.org&#x2F;</a>) if: a) React is an option b) you (can) use nodejs on backend c) PDF preview is required on frontend (optional) d) you need to generate same PDFs on backend (optional)
archydebabout 2 years ago
Workflow I&#x27;ve used previously:<p>1. Render html (easy with a templating language e.g. Jinja for Python)<p>2. Turn the html into a pdf (e.g. wkhtmltopdf in Python)
评论 #35839646 未加载
评论 #35856449 未加载
alhirzelabout 2 years ago
<a href="https:&#x2F;&#x2F;weasyprint.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;weasyprint.org&#x2F;</a>
ehutch79about 2 years ago
You need to at least tell us what your backend is.<p>Have you googled your question yet? Is there an issue with the solutions you did find? Why would you want an external service? You could be exposing private info using external services.
评论 #35843376 未加载
quickthrower2about 2 years ago
Generate from what format and in what language?<p>You could run pandoc in a lambda perhaps?
moritzwarhierabout 2 years ago
What backend exactly? If you&#x27;re into old school PHP, try FPDF maybe. But you&#x27;ll probabl have to write your own layout code.
BOOSTERHIDROGENabout 2 years ago
I&#x27;m curious maybe anyone have experience in large bank or broker how do they generate statements for customers ?
NanoWarabout 2 years ago
I can absolutely recommend &quot;gotenberg&quot; in a docker and some react web app to render the actual web app!
deadly_synabout 2 years ago
Markdown template + pandoc would be a very minimal typeset solution.
Gnarlabout 2 years ago
Clarification question: what is your backend tech?
mcwhyabout 2 years ago
there is borbpdf.com
评论 #35843390 未加载