Skip to content

v1.3 • Utils • 6kb gzipped • MIT

PrintCanvas

Export any canvas to print-ready PNG, SVG or PDF at whatever resolution the page needs.

★ 1.0kGitHub
↓ 18.6k / week● MIT● TS 5.0+
printcanvas-preview.png
Abstract preview graphic for PrintCanvas

// why printcanvas

Print resolution, not screen

Re-renders at the target device pixel ratio instead of upscaling the screen bitmap, so text stays crisp on paper.

● 0 deps● 6kb gzipped● tree-shakeable

// stack

Vector where it counts

Shapes and text export as vectors in SVG and PDF; only true bitmaps are rasterised.

PrintCanvas started as a single file in a client project and stayed small on purpose. It does one job, it does it in 6kb gzipped, and it has no runtime dependencies.

Getting started

Install it, import it, call it:

npm i printcanvas-js

Re-renders at the target device pixel ratio instead of upscaling the screen bitmap, so text stays crisp on paper.

What it does not do

It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.

  • True vector PDF
  • Arbitrary scale factors
  • MIT licensed, commercially friendly

Features

True vector PDF

Text stays selectable and searchable in the exported document.

Arbitrary scale factors

Export at three times device resolution without touching your drawing code.

ESM and types

Ships module and CommonJS builds with hand-written type definitions and source maps.

Tree-shakes cleanly

Every export is side-effect free, so importing one function costs one function.

Tested to the edges

Ninety-eight percent branch coverage, with the awkward cases written first.

Node and browser

One build runs in both, with no conditional exports to get wrong.

Get PrintCanvas v1.3

4 files • .min.js 6kb • .zip 53kb • sha384 verified

Changelog

v1.3 May 1 2026 • latest
  • Vector text in PDF export
  • Arbitrary scale factor support
  • CMYK hint for print workflows
v1.2 Mar 14 2026
  • Fixed a memory leak on repeated teardown
  • Source maps now published with every build
v1.1.4 Feb 8 2026
  • Type definitions rewritten by hand
  • Dropped the last runtime dependency
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

FormFlow

Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.

View →

Drop it in this afternoon.

MIT licensed. Commercial friendly. Five-minute setup.