Giter VIP home page Giter VIP logo

fpdi's Introduction

FPDI - Free PDF Document Importer

Latest Stable Version Total Downloads Latest Unstable Version License

A clone of FPDI for GitHub/Composer.

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.

Installation with Composer

FPDI is an add-on for FPDF. Additionally FPDI can be used with TCPDF. For completion we added a FPDF repository which simply clones the offical releases.

This package comes without any dependency configuration in the composer.json file. It's up to you to load the desired package as described below.

A basic installation via Composer could be done this way:

$ composer require setasign/fpdi:1.6.2

or you can include the following in your composer.json file:

{
    "require": {
        "setasign/fpdi": "1.6.2"
    }
}

Evaluate Dependencies Automatically

To load dependencies automatically we prepared kind of metadata packages. To use FPDI with FPDF use this package:

{
    "require": {
        "setasign/fpdi-fpdf": "1.6.2"
    }
}

For TCPDF use this:

{
    "require": {
        "setasign/fpdi-tcpdf": "1.6.2"
    }
}

Manual Dependencies

To support both FPDF and TCPDF its up to you to load the preferred package before the classes of FPDI are loaded. By default FPDI will extend FPDF. If the TCPDF class exists, a new FPDF class will be created which will extend TCPDF while FPDI will extend this.

To use FPDI with FPDF include following in your composer.json file:

{
    "require": {
        "setasign/fpdf": "1.8",
        "setasign/fpdi": "1.6.2"
    }
}

If you are using TCPDF, your have to update your composer.json respectively to:

{
    "require": {
        "tecnickcom/tcpdf": "6.2.13",
        "setasign/fpdi": "1.6.2"
    }
}

Additionally you have to trigger composers autoloader for the TCPDF class before you are initiating FPDI:

class_exists('TCPDF', true); // trigger Composers autoloader to load the TCPDF class
$pdf = new FPDI();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.