PdfCanvas
IT

pdfcanvas documentation

pdfcanvas is a client-side PDF editor engine plus a complete editor UI. It has no backend, no license key and no telemetry. These pages cover install, the core API, and the ready-made editor.

Open the PDF editorLast updated:

Five-line start

npm i pdfcanvas pdfjs-dist pdf-lib @embedpdf/pdfium

import { PdfCanvas } from "pdfcanvas";

const pdf = new PdfCanvas(document.querySelector("#editor")!, {
  workerSrc: "/pdfjs/pdf.worker.min.mjs",
  pdfiumWasmUrl: "/pdfium/pdfium.wasm",
  fontAssetsUrl: "/fonts/",
});

await pdf.load(file);

Two entry points

  • pdfcanvas — the engine: render, objects, pages, history, export.
  • pdfcanvas/editor — the full UI: toolbar, page rail, inspector, signatures, templates, autosave.

Requirements

Any modern browser with WebAssembly. TypeScript types are included. The editor needs a container with an explicit height, for example a flex child with min-height: 0.

Self-hosted assets

The worker, CMaps, standard fonts and the PDFium WebAssembly file must be served from your own origin. The library never loads them from a CDN, which is what keeps documents local.

In this section

Frequently asked questions

+Does it work with React, Vue or Svelte?

Yes. The library is plain TypeScript and DOM. Mount it inside a ref or an effect, and call destroy() on unmount.

+Is there a server-side build?

No. It depends on browser APIs. Use a dedicated library for Node pipelines.

+Which PDF engine does it use?

PDF.js for rendering, PDFium compiled to WebAssembly for editing original text, and pdf-lib for writing the output.

Related pages