8 comments

  • pabs3 2 days ago ago

    Just print to PDF in a browser, or automate that using a browser automation tool. For a non-browser-based open source solution, WeasyPrint.

    https://weasyprint.org/

    For a proprietary solution, try Prince XML:

    https://www.princexml.com/

  • kappadi3 2 days ago ago

    Puppeteer and Playwright are the main open-source options nowadays, both solid for HTML → PDF once your print CSS is sorted. Don’t forget proper page breaks (break-before/after/inside) — e.g. break-after: page works in Chromium, while always doesn’t. For trickier pagination you can look at Paged.js, and I’d test layouts in Chrome/Edge before automating.

    Shameless plug: I run yakpdf.com, a hosted Puppeteer-based service if you want to avoid self-hosting. https://rapidapi.com/yakpdf-yakpdf/api/yakpdf

  • throw03172019 2 days ago ago

    I run chromium on my server and render the PDF from there using puppeteer.

  • zja 2 days ago ago

    pandoc

    • hhthrowaway1230 2 days ago ago

      doesn't pandoc rely on some engine itself?

      • cpach 3 hours ago ago

        Yep, you need something like XeTeX in order to render the PDF.

      • brudgers 4 hours ago ago

        Curious why that matters to you?

        I mean everything has dependencies (some of the solutions elsewhere require Chrome and other common solutions require the JVM). At least Pandoc is GPL.

  • mightjustwork 2 days ago ago

    https://gotenberg.dev/ ...has been working well for me for the last few years. It's a headless instance of Google Chrome with a golang wrapper. Runs well in Docker or a cloud instance.