Search by

libresign / xobject-template

libresign

Minimal HTML+CSS to reusable PDF Form XObject compiler.

Package info

github.com/LibreSign/xobject-template

pkg:composer/libresign/xobject-template

Fund package maintenance!

libresign

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.0 2026-11-24 02:39 UTC

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

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