Skip to content

A minimal demo that shows how to render and print PDF files in the browser using PDF.js. Includes three printing methods: window.print(), Print.js for styled canvas output, and iframe-based native PDF printing.

Notifications You must be signed in to change notification settings

PSPDFKit-labs/pdfjs-print-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PDF.js Print Demo

A simple browser demo to render and print PDFs using PDF.js with three methods:

  • window.print() — quick canvas-based printing
  • Print.js — styled HTML/canvas printing
  • Hidden iframe — full-fidelity native PDF printing

Read the full tutorial here: How to print PDFs using PDF.js

Getting Started

  1. Clone or download the project
  2. Add your PDF file as example.pdf
  3. Open index.html in a modern browser

No build tools required — just HTML, JS modules, and CDN links.

Print Method Comparison

Method Quality Customization Requires File
window.print() Medium Low No
Print.js Medium High No
iframe High Low Yes

Contributing

Please ensure you have signed our CLA so that we can accept your contributions.

About

A minimal demo that shows how to render and print PDF files in the browser using PDF.js. Includes three printing methods: window.print(), Print.js for styled canvas output, and iframe-based native PDF printing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published