Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@simtabi/printcraft

npm Tests Static analysis License MIT

Client-side printing you can aim: real paginated sheets with numbers and borders, a region tool that prints what you drew, redaction that is verified rather than hoped for, and a right-click menu, command palette and keyboard commands that are there the moment the script loads.

Runs in any browser with afterprint and document.fonts: Chrome, Edge, Firefox and Safari, current and two back. TypeScript source, zero runtime dependencies, ESM + UMD builds, and a command line for CI.

Try the demo: every job, the interaction layer and the inspector, with nothing to install.

Install

npm install @simtabi/printcraft
import Printcraft from '@simtabi/printcraft'; // esm
const Printcraft = require('@simtabi/printcraft'); // cjs (umd build)

Or a script tag. The UMD build sets a Printcraft global and boots the declarative layer automatically:

<script src="printcraft.umd.js"></script>
<button data-printcraft="#invoice">Print</button>

Documentation

Full documentation: https://opensource.simtabi.com/documentation/simtabi/printcraft-js/

Guides

  • Installation — package, script tag, and build output
  • Demo — where to run it, and how its assets are built
  • Getting started — your first job, in each of the three surfaces
  • Surfaces — imperative, declarative, and JSON config
  • Configuration — page defaults, config files, content annotations
  • Architecture — the pipeline, the module layout, and why it is shaped this way
  • Pagination — real sheets, page numbers, borders and running bands
  • Security — the threat model, and what redaction guarantees
  • Print backends — sending a job to a server or a companion service
  • Comparison — lineage from ezPrintJS, and what changed
  • Release — versioning and the publish process

Reference

Recipes

Community

Questions and ideas belong in GitHub Discussions; bugs in Issues.

Contributing & security

See CONTRIBUTING.md for local setup and conventions, and SECURITY.md to report a vulnerability privately.

License

MIT. A clean-room reimplementation and extension of the public API of ezPrintJS v1.1.0 (2017); no code from that commercial library was used. Icon artwork from Tabler Icons (MIT).

About

Data-driven client-side printing: print regions, redact, auto-blank PII, crop marks, draw-to-print. Zero dependencies.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages