Download the PHP package jdz/pdfbuilder without Composer

On this page you can find all versions of the php package jdz/pdfbuilder. 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 pdfbuilder

jdz/pdfbuilder

PHP library for building structured PDFs using TCPDF and FPDI.

Provides a Builder/Modelizer pattern for generating multi-page PDFs with YAML-driven configuration, automatic config inheritance, color/font management, and unit conversion utilities.

Requirements

Installation

PDF 1.5+ support (optional)

FPDI natively handles PDF documents up to version 1.4. To import PDF 1.5+ files (those using compressed cross-references and object streams), you need the commercial FPDI PDF-Parser add-on from Setasign.

  1. Purchase a license at setasign.com

  2. Add the Setasign private Composer repository to your project's composer.json:

  3. Require the package (you will be prompted for your Setasign credentials):

Once installed, FPDI automatically detects the parser and enables PDF 1.5+ support — no code changes needed.

Architecture

Core classes

Class Role
Builder Abstract base class (implements Contract\BuilderInterface). Loads YAML modelizer configs with inheritance, registers fonts, orchestrates PDF generation. Concrete builders extend this and implement build(). Holds the sources path, target path and data (getters/setters), plus a withToc(bool) / getToc() flag a build can read to print a table of contents.
Modelizer Base class for rendering a single page type. Subclasses override Page(), Header(), and Footer() to define layout. Handles margins, page breaks, and page number placeholders.
Data Configuration container extending jData. Manages colors (Color), fonts (Font), and provides unit conversion methods (px2mm, px2pt, mm2px, percent2mm).
Pdf FPDI/TCPDF bridge. Extends setasign\Fpdi\Tcpdf\Fpdi with custom font loading, model-based Header/Footer callbacks, and page number offset support.
Helper Utility class for unit conversions, image sizing/resolution, border definition, and TOC export.

Built-in modelizers

Modelizer Purpose
ImageModelizer Renders a full-page image scaled to page width.
PdfModelizer Includes pages from an existing PDF file via FPDI.
FormAbstractModelizer Provides form building helpers: text fields, checkboxes, radio buttons, signatures.

Supporting classes

Class Purpose
Color RGB/Hex color with HSV conversion, lighten() and darken() methods.
Font Font name, size, and style holder.
Book Container for Toc and BookText in multi-page documents.
BookText Multilingual text management (fr, en, it) with plural support.
Toc Table of Contents with page mark tracking.
BookToc Toc that prints itself into the PDF (setPdf(), setHelper(), withPrintToc(), toPdf() via Helper::exportToc()).

Configuration

Modelizer configs are YAML files stored in a config/ directory. They support inheritance via the inherits key.

Example: modelizer.formation.yml

The base config provides defaults for all colors, fonts, and font sizes:

Configs are loaded from your build() via $this->loadModelizerConfig('formation') (protected), which reads <sourcesPath>config/modelizer.<name>.yml, resolves the full inheritance chain and merges colors, fonts, and all other properties. A name without a file loads base.

Every measure (borderWidth, the *Fsize sizes, margins, paddings) is read as a float: 0.1, 7.5 and "7.5" all work. borderWidth is a line width in mm (getBorderWidth(0.1) is a tenth of it).

Usage

1. Create a Modelizer (page layout)

2. Create a Builder

3. Generate the PDF

Custom fonts

Register fonts in your Builder's build() method before creating the Modelizer:

Font definition files (TCPDF PHP font files) go in the folder TCPDF reads fonts from: define K_PATH_FONTS before TCPDF loads, as examples/autoload.php does (it points at examples/resources/fonts/). The examples ship Helvetica, Courier, Montserrat, and Merienda.

Color manipulation

The Color class supports hex-to-RGB conversion, HSV transformations, and lighten()/darken() methods.

Examples

The examples/ directory contains complete working examples:

Example Description Output
cv.php CV / Resume Single-page CV with photo, skills, experience
offre.php Job offer Job posting with company info and description
formation.php Training course Course sheet with programme, sessions, side panel
catalogue.php Multi-page catalogue Cover page + category separators + 10 course sheets
invoice.php Invoice Professional invoice with items table and totals
booktoc.php Book with TOC Cover + table of contents + 5 chapters with clickable links

Run an example:

Testing

Changelog

License

MIT - See LICENSE for details.


All versions of pdfbuilder with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
tecnickcom/tcpdf Version ^6.3
setasign/fpdi Version ^2.6
symfony/yaml Version ^7.4
jdz/data Version ^2.0.4
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 jdz/pdfbuilder contains the following files

Loading the files please wait ...