libresign / xobject-template
Minimal HTML+CSS to reusable PDF Form XObject compiler.
Fund package maintenance!
Requires
- php: ^8.2
- symfony/process: ^7.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- roave/security-advisories: dev-latest
- signerphp/pdf-core: ^0.1.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-24 14:52:35 UTC
README
XObject Template
Minimal HTML+CSS to reusable PDF Form XObject compiler for visible signature appearances and document overlays.
What is xobject-template?
xobject-template is a focused PHP rendering engine that compiles a deterministic HTML/CSS subset into Form XObject-oriented output (contentStream, resources, bbox) for downstream PDF workflows.
Why it exists
Many systems need stable visual signature/stamp/label appearances, but do not want browser-grade rendering complexity inside PDF pipelines.
This package provides a scoped, integration-friendly rendering layer for that gap.
Install
composer require libresign/xobject-template
Quick example
<?php use LibreSign\XObjectTemplate\Dto\CompileRequest; use LibreSign\XObjectTemplate\XObjectTemplateCompiler; $compiler = new XObjectTemplateCompiler(); $result = $compiler->compile(new CompileRequest( html: '<div style="font-size:12;color:#111111">Signed by {{ name }}</div>', width: 240.0, height: 84.0, context: ['name' => 'Alice'], )); // $result->contentStream // $result->resources // $result->bbox
LibreSign use case
- LibreSign project: https://github.com/LibreSign/libresign
Contributing
- Repository guide:
CONTRIBUTING.md
If this package helps your project generate reliable PDF signature appearances, please star the repository. It helps other developers discover the project and signals that this work is worth maintaining.
Support the project
- Sponsor maintenance: https://github.com/sponsors/LibreSign