Download the PHP package rust-pdf/rustpdf without Composer
On this page you can find all versions of the php package rust-pdf/rustpdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rust-pdf/rustpdf
More information about rust-pdf/rustpdf
Files in rust-pdf/rustpdf
Package rustpdf
Short Description Generate, edit, sign and process PDFs in PHP: PDF/A, AES-256 encryption, digital signatures (PAdES), forms, stamping, redaction, text extraction and page rendering. Docs: https://rustpdf.dev/docs/php
License proprietary
Homepage https://rustpdf.dev/docs/php
Informations about the package rustpdf
rustpdf (PHP binding)
Idiomatic PHP binding for the rust-pdf core over its C ABI (libpdf_ffi),
using the built-in FFI extension (ext-ffi, PHP 8.1+) — no compilation
needed. It covers the whole product surface: vector graphics, embedded/subsetted
fonts and text, wrapping paragraphs, images, PDF/A (levels 1b–3a),
tagged/accessible output, embedded-file attachments, AcroForm fields,
manipulation (merge/split/rotate/optimize/incremental update), text
extraction, page rendering (page to PNG image), encryption (RC4 / AES-128 / AES-256) and digital signatures
(PKCS#7 / PAdES) — plus feature licensing.
Classes (namespace RustPdf, PSR-4 under src/):
Pdf— static helpers (version,activateLicense,extractText,sign,timestamp,addDss, plus deferred/HSM signing:signWith,beginSigning,completeSignature,listSignatures);Document— fluent authoring API;EditableDoc— manipulation API;PdfaLevel,Align,AFRelationship,Encryption— enums;PdfException,Ffi(internal FFI loader).
Install
The package is pure PHP; the native libpdf_ffi is fetched per platform from the
GitHub Release. Ffi::libPath() resolves it in this order:
RUSTPDF_LIB— an absolute path to a library you provide (always wins);- the bundled copy under
lib/<os>-<arch>/, placed there by the installer; - the dev tree (
target/{debug,release}, walking up fromsrc/); - lazy download of the matching prebuilt library on first use.
Because Composer only runs scripts for the root package (never a dependency),
the download can't fire automatically on composer require. The step-4 lazy
fetch covers most setups with zero config, but if your production filesystem is
read-only, fetch the library once at deploy/CI time instead:
Or wire it into your root composer.json:
Set RUSTPDF_NO_DOWNLOAD=1 to forbid the network fetch (you must then supply the
library via RUSTPDF_LIB or a local cargo build -p pdf-ffi --release).
Enabling ext-ffi
FFI ships with PHP 8.1+ but is often disabled in production. In CLI it's
enabled by default; for FPM/web set in php.ini:
Without it, install succeeds but the first call throws.
Quick start
Corporate features (PDF/A, signing, encryption, accessibility, page rendering — a Pro feature) require a license;
without one they throw PdfException. See docs/LICENSING.md.
Deferred / HSM signing (key stays out of the library)
When the private key lives in an HSM, a cloud KMS, a smartcard or a PKI authentication token, it must never enter this library. Two flows keep it there and work with any PKI (eIDAS, AATL and the like):
Model A — bring your own signer. Pdf::signWith builds the CMS signed
attributes and calls your closure with the bytes to sign; the closure forwards
them to the HSM/KMS and returns the raw RSA signature. The cert and any
intermediates are passed independently of the key.
Model B — two-phase. When the signer is asynchronous (a remote service or a user interaction), split it: prepare the document, ship the hash, then embed the finished CMS container.
Pdf::listSignatures($pdf) returns the existing signature fields (each a
SignatureField with $name / $signed) so you can detect prior signatures
before adding another. SigningOptions also carries certify (a Certify
DocMDP level) and policy (a SignaturePolicy for PAdES-EPES).
Test
All versions of rustpdf with dependencies
ext-ffi Version *