Reputation: 1
I want to generate PDF or Msword that base on a template that I uploaded But I don't know any library or anything about it. Can you guys recommend me something or where should I start looking? Many thanks in advance.
Upvotes: 0
Views: 114
Reputation: 507
For template you can use FPDI. This the example from official site:
<?php
use setasign\Fpdi\Fpdi;
use setasign\Fpdi\PdfReader;
require_once('fpdf/fpdf.php');
require_once('fpdi2/src/autoload.php');
$pdf = new Fpdi();
$pageCount = $pdf->setSourceFile('Fantastic-Speaker.pdf');
$pageId = $pdf->importPage(1, PdfReader\PageBoundaries::MEDIA_BOX);
$pdf->addPage();
$pdf->useImportedPage($pageId, 10, 10, 90);
$pdf->Output('I', 'generated.pdf');
Upvotes: 1