github dichovsky/pdf-to-png-converter v4.3.0

3 hours ago

The public API, option types and Node.js >=22.13.0 requirement are unchanged from 4.2.1. The full list of changes is in the CHANGELOG.

Highlights

  • CCITT, JBIG2 and JPEG 2000 images render again. They came out blank with no error, because pdf.js never received its wasmUrl (#278). A hang when several conversions ran at the same time on the main thread is also fixed (#288).
  • Fonts and CJK text now render correctly whatever the working directory (npx, pnpm, a process started outside the project root). pdf.js assets now come from the installed pdfjs-dist package instead of from ./node_modules.
  • pdfjs-dist 6.4.299 and @napi-rs/canvas 1.0.13. Rendering is faster (the full fixture set took 2.4 s, down from 4.2 s, and image-heavy pages are up to 3× faster). Decoding very large images is slower (54 s for a 529-million-pixel image), and PNG bytes can differ slightly.
  • New: the PDF_TO_PNG_PASSWORD environment variable for the CLI, the PDF_TO_PNG_WASM_MISSING and PDF_TO_PNG_DISABLE_FONT_FACE_IGNORED process warnings, and SharedArrayBuffer input from other realms.
  • Hardening: input validation is stricter, a failed write no longer leaves a truncated PNG, the duplicate-name check now folds Unicode, and 2 GiB+ inputs are now read in chunks.

Check before upgrading

These changes can make a call that worked on 4.2.1 fail or produce different output:

  • The CLI rejects more than one positional argument, such as a *.pdf glob or file.pdf --silent true.
  • A string input longer than 4096 characters is rejected before it reaches the filesystem.
  • Output names that differ only by Unicode case or normalization, such as straße.png and STRASSE.png, are rejected as duplicates on every filesystem.
  • returnMetadataOnly and returnPageContent: false reject a page with a side longer than 1,000,000 px.
  • Width and height can grow by one pixel at some scales (2974 × 3849 becomes 2975 × 3850).
  • disableFontFace: false is ignored, and the library emits a warning.
  • Images in these formats now decode, so memory and time per page can go up: about 8 bytes per declared pixel per rendering thread. Set memory and time limits for untrusted PDFs.
  • A declared image of about 537 million pixels or more is now silently left out of the page, where it used to make the conversion fail.

Don't miss a new pdf-to-png-converter release

NewReleases is sending notifications on new releases.