* @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD * @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE) * @link https://github.com/tecnickcom/tc-lib-pdf * * This file is part of tc-lib-pdf software library. */ // NOTE: local file reads (images, fonts, attachments) are restricted to an allowlist of // trusted paths that covers this package tree, so run the examples in place. To read assets // from other locations, list them in the 'allowedPaths' entry of the fileOptions constructor // parameter (see E047_remote_resources_security.php). // NOTE: run make fonts in the project root to generate the dependencies and example fonts. // autoloader when using Composer require __DIR__ . '/../vendor/autoload.php'; // define fonts directory \define('K_PATH_FONTS', \realpath(__DIR__ . '/../vendor/tecnickcom/tc-lib-pdf-font/target/fonts')); // autoloader when using RPM or DEB package installation //require ('/usr/share/php/Com/Tecnick/Pdf/autoload.php'); // main TCPDF object $pdf = new \Com\Tecnick\Pdf\Tcpdf( unit: \Com\Tecnick\Pdf\Page\Unit::Millimeter, isunicode: true, subsetfont: false, compress: true, mode: \Com\Tecnick\Pdf\PdfConformance::Pdfa3, objEncrypt: null, ); // ---------- $pdf->setCreator('tc-lib-pdf'); $pdf->setAuthor('Nicola Asuni'); $pdf->setSubject('tc-lib-pdf example: 001'); $pdf->setTitle('Example Invoice Factur-X 1.07 / ZUGFeRD 2.3'); $pdf->setKeywords('TCPDF tc-lib-pdf invoice Factur-X ZUGFeRD e-invoice XML'); $pdf->setPDFFilename('001_invoice.pdf'); $pdf->setViewerPreferences(['DisplayDocTitle' => true]); $pdf->enableDefaultPageContent(); // ---------- // Insert fonts $bfont1 = $pdf->font->insert($pdf->pon, 'dejavusans', '', 10); // ---------- // Factur-X 1.07 / ZUGFeRD 2.3 $pageF01 = $pdf->addPage(); $pdf->setBookmark(name: 'Factur', link: '', level: 0, page: -1, posx: 0, posy: 0, fstyle: 'B', color: ''); $pdf->page->addContent($bfont1['out']); $invoiceHTML = '
|
Seller ELEKTRON Industrieservice GmbH Geschäftsführer Egon Schrempp Amtsgericht Stuttgart HRB 1234 Erfurter Strasse 13 74465 Demoort, DE VAT: DE136695976 |
Invoice No.: 181301674 Invoice Date: 15.11.2024 Delivery Date: 01.11.2024 Order Ref.: per Mail vom 01.09.2024 Project: 13130162 |
| Pos. | Description | Qty | Unit | Unit Price | Amount |
|---|---|---|---|---|---|
| 01 | TGA Obermonteur/Monteur Beamermontage |
3 | HUR | 43.20 | 129.60 |
| 02 | Beamer-Deckenhalterung Außerhalb Angebot |
1 | H87 | 122.50 | 122.50 |
|