Giter Club home page Giter Club logo

Comments (1)

fpdf-easytable avatar fpdf-easytable commented on June 16, 2024

Hi, this is how you should do it: assuming that fpdf.php, easyTable.php, exfpdf.php, fpdi.php and any other files from this libraries are in the same directory. So the class exfpdf should extends fpdi:

In exfpdf.php:

`<?php
// include 'fpdf.php'; <-- no needed here
include 'fpdi.php';

class exFPDF extends FPDI
{
etc
etc
`
and in your project:

`<?php
include 'fpdf.php';
//include 'fpdi.php'; no needed because exfpdf is extending fpdi class
include 'exfpdf.php';
include 'easyTable.php';

//$pdf = new FPDI(); remember exfpdf is extending the fpdi class
$pdf=new exFPDF(); // so we initiate exFPDF instead of FPDI

// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile("example-2.pdf");
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 10, 10, 100);

//add another page
$pdf->AddPage();
$pdf->SetFont('helvetica','',10);

$table1=new easyTable($pdf, 2);
$table1->easyCell('Sales Invoice', 'font-size:30; font-style:B; font-color:#00bfff;');
$table1->easyCell('', 'img:fpdf.png, w80; align:R;');
$table1->printRow();
//etc
//etc
`

from fpdf-easytable.

Related Issues (20)

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.