Skip to converter
Diagram2PDF

Vector PDF vs. PNG Export in Excalidraw: Why Rasterization Ruins Large Prints

An engineering breakdown of DPI resolution math, cubic Bézier curve evaluation on wide-format plotters, TrueType VFS font embedding, and why infinite-canvas whiteboards require ISO 216 vector projection for physical printing.

1. The DPI Resolution Math: What Happens When You Stretch a PNG to ISO A1

When designing a system architecture diagram on a modern laptop display (such as a MacBook Pro Retina or 4K Dell UltraSharp), an Excalidraw diagram looks deceptively crisp. That sharpness is an illusion of screen pixel density (~220 PPI viewed across a 14-inch physical width).

When you click Export to PNG in Excalidraw, the HTML5 <canvas> element serializes the bounding box into a 2D array of RGBA pixels. Let’s examine the exact resolution math when that bitmap is sent to an architectural plotter:

// ISO A1 Sheet Physical Dimensions
Width = 841 mm = 33.11 inches
Height = 594 mm = 23.39 inches
// Required Pixel Grid at 300 DPI (Print Quality) vs. 600 DPI (Plotter Line Art)
Pixels @ 300 DPI = 9,933 × 7,017 px (69.7 Megapixels)
Pixels @ 600 DPI = 19,866 × 14,034 px (278.8 Megapixels — Exceeds browser canvas limit!)

Because modern browsers enforce a hard security and GPU memory ceiling on HTMLCanvasElement dimensions (typically 16,384 × 16,384 pixels or 268 megapixels total area), exporting a large diagram as a high-DPI raster image either crashes the browser tab or silently downscales the export. Worse yet, bilinear interpolation during print scaling introduces grey anti-aliasing halos around black text, forcing the printer to fire composite CMYK droplets instead of pure black (K=100%) pigment ink.

2. Resolution Independence: Cubic Bézier Curves in SVG & PostScript/PDF

A common misconception is that Excalidraw’s organic, sketchy look requires bitmap textures. In reality, Excalidraw’s underlying rendering engine (rough.js) is 100% mathematical. Every hand-drawn rectangle, hachure fill line, and curved arrow is defined by parametric cubic Bézier equations:

B(t) = (1 - t)³ · P₀ + 3(1 - t)² · t · P₁ + 3(1 - t) · t² · P₂ + t³ · P₃ , for t ∈ [0, 1]

When our converter invokes exportToSvg and translates the resulting DOM tree through svg2pdf.js into jsPDF, those four control points (P₀, P₁, P₂, P₃) are scaled into ISO 216 millimeter coordinates and written directly into the PDF content stream. Whether you print the resulting file onto an A4 handout or a 1,200 DPI A0 poster, the printer’s hardware Raster Image Processor evaluates B(t) at the physical resolution of the printhead.

Ad space reserved (article-mid)

3. Solving the WOFF2 vs. TrueType (.ttf) Font Embedding Gap in PDFs

If you simply export an .svg file from Excalidraw and open it on another computer or send it to a print shop, all of your hand-drawn labels suddenly revert to Times New Roman or Arial, overflowing their boxes and breaking arrow alignments.

Why does this happen? Web browsers use WOFF2 (Web Open Font Format 2) with Brotli compression for CSS @font-face rendering, whereas the ISO 32000 PDF specification requires embedded TrueType (.ttf) or OpenType tables inside the PDF file’s /FontDescriptor dictionary.

To guarantee zero font substitution, our build pipeline decompresses Excalidraw’s bundled WOFF2 font assets into standalone TrueType binaries (Excalifont-Regular.ttf, Virgil-Regular.ttf, CascadiaCode-Regular.ttf, ComicShanns-Regular.ttf, Nunito-Regular.ttf, Lilita-Regular.ttf, and LiberationSans-Regular.ttf) and registers them inside jsPDF’s Virtual File System before rendering a single text node.

4. Plotter Economics: Why Ink-Saving Light Mode Conversion Matters

Many developers prefer working in Excalidraw’s Dark Mode (#121212 charcoal canvas with inverted light strokes). However, printing a dark-mode canvas on an A1 sheet requires covering 0.50 m² of paper with heavy black ink:

  • Ink Cost: Flooding an A1 sheet with solid black background consumes roughly 8 to 12 milliliters of pigment ink—costing 15× more per sheet than a line-art print on white bond media.
  • Paper Cockling & Smudging: Uncoated 80 gsm plotter paper absorbs water-based pigment ink, causing the sheet to buckle and potentially strike the printhead carriage.
  • Automatic Light-Mode Inversion: Our converter’s Print-Friendly Light Mode toggle instructs Excalidraw’s vector exporter to invert luminance values during SVG generation (`exportWithDarkMode: false`), producing dark, high-contrast strokes on a pure white sheet with one click.

Vector vs. Raster Excalidraw Printing FAQs

Technical questions on DPI math, PDF font tables, and wide-format reprographics.

Why does a 2x or 3x PNG export from Excalidraw still look blurry on an A1 poster?
A 300 DPI print on an ISO A1 sheet (23.39 × 33.11 inches) requires a raster bitmap of 7,017 × 9,933 pixels (nearly 70 megapixels). Most Excalidraw PNG exports are capped by browser canvas limits or exported at 1x–2x screen resolution (around 2,500 × 1,600 pixels). Stretching a 2,500 px image across 841 mm drops the physical resolution to ~75 DPI, making text fuzzy and diagonal lines jagged.
How does PDF store Excalidraw’s hand-drawn "rough.js" strokes as vectors?
Excalidraw uses rough.js to generate randomized multi-pass cubic Bézier curves that simulate hand-drawn pen strokes. When exported to SVG and compiled into PDF via svg2pdf.js, each stroke is stored as mathematical path operators (m for moveto, c for curveto, and S for stroke). The printer’s Raster Image Processor (RIP) evaluates those equations at the plotter’s native hardware resolution (typically 1,200 or 2,400 DPI).
Does a vector PDF file weigh more or less than a high-resolution PNG?
A vector PDF is dramatically smaller. An uncompressed or high-DPI A1 raster image can easily exceed 25 MB to 80 MB, whereas a vector PDF containing 150 architecture nodes and embedded TrueType font subsets typically weighs between 120 KB and 450 KB.
Can I search and highlight text inside the exported vector PDF?
Yes! Because our converter registers Excalidraw’s TrueType (.ttf) fonts in jsPDF and writes native PDF text strings (<text> -> BT /F1 Tf ET) rather than outlining text into dead shapes or pixels, you can press Ctrl+F / Cmd+F in any PDF viewer to search for service names, database tables, or IP addresses inside your diagram.