Download the PHP package setasign/setafpdf without Composer

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

SetaFPDF

SetaFPDF is a clone of FPDF with an almost compatible interface while using SetaPDF-Core internally for the PDF generation.

Motivation

The main motivation for this project was to be able to create PDF/A documents in PHP without changing all existing PDF generation scripts which rely on FPDF.

FPDF is a wide spread and very common PHP library for PDF generation. It is small, well tested and runs on millions of websites. It also comes with several extensions and an active forum.

The SetaPDF-Core component is a PHP component which allows PHP developers to interact with existing PDF documents on a low level. While there is no high-level API for PDF generation it comes with all low-level features which are required to create PDF/A documents:

Additionally it comes with other nice features which would be available automatically:

Bringing both SetaPDF and FPDF together result in SetaFPDF: An almost identical interface of FPDF backed up by SetaPDF on the lower level.

Future of this project

This project is not a start of a new PDF generation project in PHP but it is a temporary solution to improve existing projects which rely on FPDF.

Requirements

Installation

Add following to your composer.json:

and execute composer update. You need to define the repository to evaluate the dependency to the SetaPDF-Core component (see here for more details).

Evaluation version

By default this packages depends on a licensed version of the SetaPDF-Core component. If you want to use it with an evaluation version please use following in your composer.json:

Notice that the evaluation branch depends on the version for PHP 7.1 and up.

Without Composer

Make sure, that the SetaPDF-Core component is installed and its autoloader is registered correctly.

Then simply require the src/autoload.php file or register following namespaces in your own PSR-4 compatible autoload implementation:

Usage

You can use SetaFPDF the same way as FPDF. Their interfaces are almost identically. So just use another constructor and be aware of following differences:

Improved and new methods:

Examples and update information

A simple example will look like:

Nothing new here. It's code you already know from FPDF. And that's it. In the normal cases you only need to replace the constructor with \setasign\SetaFpdf\SetaFpdf, update the AddFont(), ensure UTF-8 input and you're done!

Page numbering (previously done by FPDF::AliasNbPages())

If your script relies on page numbering which is implemented by the use of AliasNbPages() in e.g. the Header() or Footer() methods you need to refactor your script. With FPDF it was done e.g. this way:

With SetaFPDF you need to iterate over the created pages and write the footer manually:

Import existing pages from existing PDF documents

There is also a clone for FPDI available. If you need the methods of FPDI just use the class SetaFpdi and you can use methods like setSourceFile(), importPage() and useTemplate():

Generating PDF/A documents

With SetaFPDF you are able to create PDF/A documents. Anyhow it's up to you to not use features which are not allowed in PDF/A. Also it's up to you to add the missing puzzle pieces through the underlaying SetaPDF functionallities. There's a simple example available in demos/pdf-a-3b.php that adds the required pieces to make the PDF PDF/A conform.

If you want to create PDF/A documents while importing other files, you need to make sure, that these documents are PDF/A already.

License

This package is open-sourced software licensed under the MIT license.


All versions of setafpdf with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-ctype Version *
setasign/setapdf-core Version ^2.29
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 setasign/setafpdf contains the following files

Loading the files please wait ....