Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pdflib Laravel Package

evosys21/pdflib

A PHP library for FPDF, TCPDF, and tFPDF that adds advanced multicell and table support. Build tag-formatted text with custom fonts, colors, links, alignment, and padding, plus feature-rich tables for PDF reports.

View on GitHub
Deep Wiki
Context7

Build status Latest Stable Version


Overview

evosys21/pdflib is a collection of PHP classes facilitating developers to create Advanced Multicells and Tables in FPDF, TCPDF, or tFPDF.

This repository is the continuation of the PDF Addons previously hosted on https://www.interpid.eu

Advanced Multicell

This addon class allows the creation of an Advanced Multicell for FPDF/TCPDF/tFPDF, which uses as input a TAG-based formatted string instead of a simple string. The use of tags allows changing the font, style (bold, italic, underline), size, and color of characters and many other features.

The function is similar to the Multicell function in the TCPDF base class with extended parameters.

Features

  • Text can be aligned, centered, or justified.
  • Different fonts, sizes, styles, and colors can be used.
  • The cell block can be framed, and the background can be colored.
  • Links can be used in any tag.
  • TAB spaces (\t) can be used.
  • Variable vertical positions can be used for subscripts or superscripts.
  • Cell padding (left, right, top, bottom) can be adjusted.
  • Controlled tag sizes can be used.

Examples

Multicell Example #1 - Overview multicell Example #1 - Overview
Code example-multicell-1-overview.php example-multicell-6-shrinking.php
Preview
Pdf example-multicell-1-overview.pdf example-multicell-1-overview.pdf

Check the examples folder for more examples with preview and the associated code.

Usage and documentation

Click here for the end-user documentation for Advanced Multicell.

Advanced table

This addon class allows creation of an Advanced Table for FPDF/TCPDF/tFPDF in the pdf document in a very simple way.

Features

  • Every table cell supports Advanced Multicell functionality.
  • Table cells can be aligned both vertically and horizontally.
  • Cells can span multiple columns and rows.
  • The table automatically splits on page breaks.
  • The header is automatically added to every new page.
  • Default properties for headers and rows can be set but can be overridden per individual cell.
  • Advanced cell-splitting mode is available.
  • The table supports transparency.
  • Images can be inserted into table cells.

A full end-user documentation for Advanced Table is available here.

Examples

Table Example #1 - Overview Table Example #1 - Overview
Code example-table-1-overview.php example-table-2-overview.php
Preview
Pdf example-table-1-overview.pdf example-table-1-overview.pdf

Usage and documentation

Click here for the end-user documentation for Advanced Table.

FAQ

Why use the custom pdf class instead of FPDF/TCPDF/tFPDF

The custom EvoSys21\PdfLib\Fpdf\Pdf object is used instead of FPDF because FPDF's private/protected properties, like widths, margins, and fonts, need to be accessed to implement add-ons.
Since FPDF doesn't provide setters/getters for these properties, the class was extended to access them.

The same is valid for all 3 pdf classes: FPDF/TCPDF/tFPDF.

For more details see:

Where do I report issues?

If something is not working as expected, please check or open an issue.

If you would like to discuss your use case or ask a general question, please use the discussions board: discussions.

Contribute

We welcome contributors to the project.

  • Before opening a pull request, please create an issue to discuss the scope of your proposal.
  • Never send PR to main unless you want to contribute to the development version of the client (main represents the next major version).

Thanks in advance for your contribution! :heart:

License

MIT License. For more information, please see the LICENSE file.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log