https://github.com/oxhq/canio
Browser-grade PDF and document rendering for Laravel powered by Stagehand
https://github.com/oxhq/canio
browser-rendering chromium laravel pdf stagehand
Last synced: 4 months ago
JSON representation
Browser-grade PDF and document rendering for Laravel powered by Stagehand
- Host: GitHub
- URL: https://github.com/oxhq/canio
- Owner: oxhq
- License: mit
- Created: 2026-03-27T09:33:33.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-30T03:33:59.000Z (4 months ago)
- Last Synced: 2026-03-30T03:49:00.672Z (4 months ago)
- Topics: browser-rendering, chromium, laravel, pdf, stagehand
- Language: PHP
- Homepage: https://oxhq.github.io/canio/
- Size: 1010 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Roadmap: docs/roadmap/v1.0.1.md
Awesome Lists containing this project
README
# Canio
Canio is the Laravel PDF package for browser-grade documents.
It exists for the cases where classic HTML-to-PDF engines stop being enough: browser-real layout, JavaScript that must finish before capture, explicit readiness, debug artifacts, and operational rendering flows.
If the only requirement is the lowest possible uncached latency on a simple static document, smaller engines such as Dompdf or mPDF can still be faster. That is not the category Canio is optimized for.
## Why Canio
Use Canio when your Laravel app needs one or more of these:
- real Chromium layout instead of approximation
- JavaScript execution before the PDF is captured
- an explicit readiness contract through `window.__CANIO_READY__`
- persisted artifacts such as HTML source, DOM snapshot, screenshot, console log, or network log
- async rendering, retries, dead letters, replay, and runtime operations
## Quick Start
```bash
composer require oxhq/canio
php artisan canio:install
```
```php
use Oxhq\Canio\Facades\Canio;
return Canio::view('pdf.invoice', ['invoice' => $invoice])
->profile('invoice')
->title('Invoice #123')
->stream('invoice.pdf');
```
By default, Canio runs in `embedded` mode:
- the Laravel package installs the matching Stagehand runtime when needed
- the first render auto-starts the local runtime
- the public API stays Laravel-native: `view()`, `html()`, `url()`
Full installation, runtime modes, and package API live in [packages/laravel/README.md](packages/laravel/README.md).
Public docs and install guide: [oxhq.github.io/canio](https://oxhq.github.io/canio/)
## Product Positioning
The claim this repository supports is narrow on purpose:
`Canio is the Laravel package for browser-real, high-fidelity PDFs.`
The benchmark harnesses in this repo currently support that claim:
- Canio is the most faithful renderer on the checked-in invoice fixture
- Canio beats Browsershot and Snappy on useful performance in that browser-grade lane
- Canio executes runtime JavaScript correctly in the probe harness
- Dompdf and mPDF still win on raw uncached latency for simple static renders
Public benchmark summary: [docs/benchmark-summary.md](docs/benchmark-summary.md)
Reproducible harnesses: [benchmarks/README.md](benchmarks/README.md)
## Cloud
Canio OSS works standalone.
Cloud is an optional paid layer on top of the package. It is not part of the required install path and it is not the core OSS story. The public package should stand on its own without any cloud dependency.
## Repository Layout
```text
/packages/laravel Laravel-facing public package
/runtime/stagehand Go runtime used by embedded and remote modes
/resources/profiles Official document profiles
/benchmarks Reproducible fidelity, fairness, and JS-capability harnesses
/examples Local example app and demo stubs
/docs Development, architecture, and benchmark notes
/docker Container and deployment assets
```
## Documentation
- Public docs: [oxhq.github.io/canio](https://oxhq.github.io/canio/)
- Package install and usage: [packages/laravel/README.md](packages/laravel/README.md)
- Launch announcement: [docs/announcements/v1.0.0.md](docs/announcements/v1.0.0.md)
- Latest release notes: [docs/releases/v1.0.1.md](docs/releases/v1.0.1.md)
- Public benchmark summary: [docs/benchmark-summary.md](docs/benchmark-summary.md)
- Production deployment guide: [docs/deployment.md](docs/deployment.md)
- Contributor setup: [docs/development.md](docs/development.md)
- Example app: [examples/laravel-app/README.md](examples/laravel-app/README.md)
- Architecture notes: [docs/architecture.md](docs/architecture.md)
- Render contract: [docs/render-contract.md](docs/render-contract.md)
## Status
The current stable release line for the Laravel package is `v1.0.1`.
That means:
- public install path is `composer require oxhq/canio`
- Stagehand release assets remain published from this monorepo
- the monorepo stays the source of truth
- the Laravel package may be mirrored into a split repository for Packagist distribution, but the product source remains here