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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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/):

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:

  1. RUSTPDF_LIB — an absolute path to a library you provide (always wins);
  2. the bundled copy under lib/<os>-<arch>/, placed there by the installer;
  3. the dev tree (target/{debug,release}, walking up from src/);
  4. 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

PHP Build Version
Package Version
Requires php Version >=8.1
ext-ffi Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rust-pdf/rustpdf contains the following files

Loading the files please wait ...