Download the PHP package francerz/exfpdf without Composer
On this page you can find all versions of the php package francerz/exfpdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download francerz/exfpdf
More information about francerz/exfpdf
Files in francerz/exfpdf
Informations about the package exfpdf
ExFPDF (Extended Free PDF)
This library extends basic functionality of the FPDF class.
FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.
Installation
The easiest and optimal way to install ExFPDF is by using Composer.
If you already using Composer, just run the next command and will be fully installed.
Extended functionality
Output result as PSR-7 ResponseInterface
The ExFPDF allows to output resultant PDF to PSR-7 compliant ResponseInterface object. Relies on PSR-17 Http Factories to create the instances.
Usage example
Alternative simplified method OutputPsr7WithManager
Alternatively you can use HttpFactoryManager to handle multiple factories instances to reduce parameters, improving reusability.
Usage example
Even simplier with in-home HTTP library
In the following example is used the simplified version with in-home HTTP library francerz/http wich is PSR-7, PSR-17 and PSR-18 compliant.
Relative Positioning and Sizing
Its allowed to use X, Y, Width and Height as percents of current page size.
Also the positioning and sizing can be relative to the page content area, inside the margins.
Therefore, you can get measure calculations with methods CalcX($x)
, CalcY($y)
,
CalcWidth($w)
and CalcHeight($h)
.
Offset positioning
Allows to increase or decrease current position.
Coordinate Pinning
It's posible to pin coordinates with a name.
Relative Cell Height based on Font Size
Define automatic line height size based on current Font Size.
Simplified content encoding
Allows internal decoding strings without writing on each cell.
Right aligned Cell
Puts a cell aligned to the right margin of the page.
Optionally $margin
can be set to displace the Cell from the right margin.
Header and Footer
Allows to define Header and Footer using anonymous functions.
SetHeader(callable $headerFunc, $headerHeight = null)
Sets a callable function that will execute when Header is loading. If parameter$headerHeight
is null, then will be calculated and body content will be displaced. If is set, then content will be displaced$headerHeight
plus the top margin.SetFooter(callable $footerFunc, $footerHeight = null)
Sets a callable function that will execute when Footer is loading. If parameter$footerHeight
is null, then will be calculated and page break will executed before reaching footer content. If is set, the footer will be displaced from based on page bottom edge.
Note:
It's important to invokeSetHeader()
andSetFooter()
beforeAddPage()
.
Tables
Table PDF creation is simplified and with automatic overflowing when cells overflows in multiple pages.
Barcode support
Using the barcode128
puts the given $code
ASCII string at the given $x
and $y
position. And with given $w
(width) and $h
(height). This measures
are compatible with the relative positioning and sizing.
If no $x
or $y
is set, then will be the current PDF position.
Using the barcode39
puts the given $code
([-0-9A-Z. *$/+%]
) string at the
given $x
and $y
position, with the given $w
(width) and $h
(height).
This meaures are compatible with the relative positioning and sizing.
QR and DataMatrix support
All versions of exfpdf with dependencies
setasign/fpdf Version ^1.8
francerz/http-utils Version ^0.2.19
ext-iconv Version >=5.4
tecnickcom/tc-lib-barcode Version ^1.17
francerz/enum Version ^0.1.1