FDPI clone
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 22 commits ahead of 25th-floor:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
filters
README.md
composer.json
fpdf_tpl.php
fpdi.php
fpdi_bridge.php
fpdi_pdf_parser.php
pdf_context.php
pdf_parser.php

README.md

FPDI - Free PDF Document Importer

Latest Stable Version Total Downloads Latest Unstable Version License

A clone to FDPI

FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF, which was developed by Olivier Plathey. Apart from a copy of FPDF, FPDI does not require any special PHP extensions.

As of version 1.2.1 FPDI can also be used with TCPDF.

Installation

Run the command:

$ composer require "setasign/fpdi"

Usage

The usage is very easy: open the document, put a page into a template, and use it like an image!

<?php
// ...

use \FPDI;
use \FPDF;

// ...
$pdf = new FPDI();

$pageCount = $pdf->setSourceFile("Fantastic-Speaker.pdf");
$tplIdx = $pdf->importPage(1, '/MediaBox');

$pdf->addPage();
$pdf->useTemplate($tplIdx, 10, 10, 90);

$pdf->Output();