Skip to content

Releases: ccjmne/puppeteer-html2pdf

2.5.1

31 Dec 22:03
2.5.1
01b6d5b

Choose a tag to compare

Support specifying Web browser flags

Control underlying Chromium flags via the following environment variable:

CHROMIUM_ARGS

2.5.0

28 Dec 18:17
2.5.0
53a55ac

Choose a tag to compare

Refactored code base, new /url endpoint, support setting PDF Information Dictionary

  1. Switch from pdfjs to pdf-lib, since pdf-lib allows reading the Information Dictionary from existing documents, so we can automatically reuse those possibly set by Puppeteer#pdf (such as the title, derived from that of the HTML Document)

  2. Add support for setting information from the PDF Information Dictionary:

    • title
    • author
    • subject
    • keywords
    • creator
    • producer
    • creationDate
    • modificationDate
  3. Introduce /url endpoint to consume one or more URLs to generate pages from

  4. Implement better error handling

  5. Prepare the terrain for a future option to print as an image rather than a PDF

New Contributors

Full Changelog: 2.4.0...2.5.0

2.4.0

19 Dec 22:48
2.4.0
de31760

Choose a tag to compare

What's Changed

Full Changelog: 2.3.2...2.4.0

2.3.1

29 May 22:34
116f4d4

Choose a tag to compare

  • Improve QoL for maintainers
  • Offer control over Web browser instance recycling
  • Fix a couple of browser management hiccups

Full Changelog: 2.3.0...2.3.1

2.3.0

10 May 13:35
f85f892

Choose a tag to compare

Perform merging in-memory for multi-page documents.

  • Tidy up implementation
    • Use chaining for express app composition
    • Leverage express' built-in error handling mechanism
    • Move print to shared-browser.ts
    • Hand-roll .gitignore
    • Remove decommissioned rc file
  • Drop tmp dependency
  • Reinstate compose.sh
    • Use docker/buildx to build images for both amd and arm architectures
    • Update target registry to ghcr.io
    • Update pre-build procedure (to none!)
    • Update shebang to use /usr/bin/env
    • Fix resetting of shell output colour

Full Changelog: 2.2.0...2.3.0

2.2.0

10 May 00:08
364b48a

Choose a tag to compare

  • Minimise browser memory footprint
    • Lazily spawn chromium,
    • share its instance between requests,
    • debounce its teardown by 30 seconds
  • Switch to using TypeScript
  • Set up linting

2.1.2

08 May 23:25
b9e8025

Choose a tag to compare

Update all dependencies, simplify setup to lessen maintenance burden.

  • Update chromium to latest stable version
  • Polish codebase
  • Update all deps
  • Switch from node:alpine to node:slim
  • Switch from npm to pnpm
  • Don't bother with minifying/bundling code
  • Keep browser open between prints
  • Manually sanitise relevant query parameters

2.1.1

22 May 03:41
0ba6177

Choose a tag to compare

Ensure adequate .pdf extension for generated document

Only append the .pdf extension to the generated file name if it's missing.

What's Changed

Full Changelog: 2.1.0...2.1.1

2.1.0

21 Nov 20:43
25d2877

Choose a tag to compare

Supporting both ARM and AMD architectures

With this version, we now offer images for both ARM and AMD architectures.
The image is now based on node:current-alpine and leverages chromium rather than google-chrome.

2.0.0

18 Jul 21:31
6269400

Choose a tag to compare

Breaking change from version 1.x.x:

The /multiple endpoint used to expect the request body to be a JSON object with a single pages property that would map to a JSON array of strings containing your HTML content for each page to be printed.
That endpoint now expects the JSON array directly.

  • version 1.x.x

    {
      "pages": [
        "<h1>First Page</h1>",
        "<h1>Second Page</h1>"
      ]
    }
  • version 2.x.x

    [
      "<h1>First Page</h1>",
      "<h1>Second Page</h1>"
    ]