MIT · PHP 7.4+ · zero dependencies

PHP PDF generation.
Zero dependencies.

A fluent PHP library for building PDF documents. Row layout, tables, headers, footers — no coordinates, no Composer bloat.

install composer require arabel/pdf
0dependencies
1file to include
PHP 7.4+compatible
MITlicense
~400lines of source
invoice.php · arabel-pdf · 49 lines
$style = new DocumentStyle();
$style->h1(22, [15, 55, 120], 'B', 12)
      ->h2(12, [15, 55, 120], 'B',  8)
      ->p(9,   [60, 60, 60],  '',   5.5);

$style->tableHeadBg = [15, 55, 120];
$style->tableHeadFg = [255, 255, 255];
$style->tableAltBg  = [235, 241, 255];

$doc = new Document('Helvetica', $style);

$doc->setHeader()
    ->bg([15, 55, 120])->fg([255, 255, 255])
    ->left('ARABEL SRL', 'Software & Digital Products')
    ->right('FATTURA', '# INV-2026-0042')
    ->height(22);

$doc->setFooter()
    ->left('Arabel Srl — P.IVA IT09876543210')
    ->right('Pagina {page}');

$doc->addPage();
$doc->spacer(6);

$doc->row()
        ->col(6)->h2('Emessa da')
        ->col(6)->h2('Fatturata a')
    ->endRow()
    ->row()
        ->col(6)->p('Arabel Srl')
        ->col(6)->p('Acme Technologies SpA')
    ->endRow();

$doc->spacer(6)->hr()->spacer(4);

$doc->table(['Descrizione', 'Qty', 'Prezzo', 'Totale'])
        ->widths([6, 1, 2, 3])
        ->align(['L', 'C', 'R', 'R'])
        ->tr(['Sviluppo modulo PDF',  '1',  '€ 3.200,00', '€ 3.904,00'])
        ->tr(['Licenza annuale Pro',  '12', '€ 49,00',    '€ 717,36'])
        ->tr(['Supporto prioritario', '1',  '€ 600,00',   '€ 732,00'])
    ->endTable();

$doc->panel()
        ->bg([15, 55, 120])->fg([255, 255, 255])
        ->padding(4)->h2('TOTALE: € 5.353,36')
    ->endPanel();

$doc->output('invoice.pdf', 'F');
// why arabel-pdf

Built different
by design.

Not a port. Not a wrapper. A fresh take on PHP PDF generation — readable code, no coordinate math, zero installs.

// api reference

Every method, one call.

Semantic methods that map directly to PDF elements. What you write is what gets rendered.

->h1() / ->h2()
Styled headings — size and color from DocumentStyle
->p()
Body text paragraph with automatic line wrapping
->row() / ->col()
Multi-column layout — 1 to 6 columns, proportional widths
->table()
Data table with header row, alternating rows, column alignment
->hr()
Full-width horizontal rule, solid or dashed
->spacer()
Vertical spacing in mm — no empty cells needed
->panel()
Colored background block — totals, callouts, highlights
->setHeader()
Global page header with left/right content and background
->setFooter()
Global footer with page number token {page}
->addPage()
New page with same header/footer — layout resets cleanly
->image()
Embed images with width control and optional caption soon
->output()
Write to file (F), send inline (I), or force download (D)
// compatibility

Already using mPDF or FPDF?

arabel-pdf is a drop-in addition — not a forced migration. Keep your existing code, use arabel-pdf for new documents. The Arabel visual builder can also export code for mPDF and FPDF if you prefer to stay on those.

mPDF HTML/CSS-based · Composer
FPDF Classic · zero deps
arabel-pdf Fluent · zero deps · new

Don't want to write the PHP by hand?

Design your document visually in the Arabel builder — drag widgets, set properties, use variables — and download clean arabel-pdf code automatically. Free, no signup needed to try.

Open visual builder →

Start using arabel-pdf
in 60 seconds.

One Composer line. MIT licensed. Full source on GitHub.

View on GitHub ↗ Use visual builder