Combine 2 classes: FPDI and FPDF Table

28 Views Asked by At

I need fpdf-table (https://www.interpid.eu/fpdf/table) and fpdi (https://www.interpid.eu/fpdf/table) combined.

The goal is to import a PDF template and then create a table. I have no idea how to combine both add ons.

I can either import the template:

use setasign\Fpdi\Fpdi;

$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile("anschreiben/blanko_ludwigsburg.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, 0, 0, 210);

or create a table:

use Interpid\PdfLib\Multicell;
use Interpid\PdfLib\Table;
use Interpid\PdfExamples\PdfFactory;
use Interpid\PdfExamples\PdfSettings;

$factory = new PdfFactory();

//get the PDF object
$pdf = PdfFactory::newPdf("table");
etc.

I need $pdf with FPDI and PDFFactory

Can anyone tell me a way to make this work?

Regards Alex

0

There are 0 best solutions below