Ringkasan Package Core
Core · LGPL-3.0Package Core (yeeefang/tcpdf-next) adalah fondasi ekosistem TCPDF-Next. Package ini berisi semua yang diperlukan untuk pembuatan dokumen PDF 2.0.
Sekilas
| Metrik | Nilai |
|---|---|
| File sumber PHP | 148 |
| Modul | 16 |
| Test | 908+ |
| Assertion | 28.881+ |
| Level PHPStan | 10 |
| Titik masuk | Document::create() |
| Lisensi | LGPL-3.0-or-later |
Titik Masuk
Semua dokumen dimulai dengan Document::create():
use Yeeefang\TcpdfNext\Core\Document;
$pdf = Document::create()
->setTitle('My Document')
->addPage()
->setFont('Helvetica', '', 12)
->cell(0, 10, 'Hello World')
->save('output.pdf');Class Document bersifat final dan mengimplementasikan PdfDocumentInterface. Fungsionalitasnya berasal dari 12 composable trait — lihat Filosofi Desain untuk detail.
Peta Modul
| Modul | Namespace | File | Dokumentasi |
|---|---|---|---|
| Core | Core\ | 6 | Dokumen |
| Contracts | Contracts\ | 7 | Referensi API |
| ValueObjects | ValueObjects\ | 5 | Value Object |
| Support | Support\ | 1 | Referensi API |
| Content | Content\ | 6 | Output Teks |
| Typography | Typography\ | 14 | Tipografi, Font |
| Graphics | Graphics\ | 19 | Warna, Grafik, Gambar |
| Layout | Layout\ | 6 | Layout |
| Html | Html\ | 8 | Rendering HTML |
| Form | Form\ | 5 | Formulir |
| Barcode | Barcode\ | 12 | Barcode |
| Navigation | Navigation\ | 11 | Navigasi |
| Accessibility | Accessibility\ | 3 | Tagged PDF |
| Security | Security\ | 14 | Enkripsi, Tanda Tangan |
| Writer | Writer\ | 8 | Output |
Kemampuan
Teks & Tipografi
Unicode, BiDi (teks bidirectional), CJK, Arabic shaping, hyphenation. Subsetting font TTF/OTF/Type1/CFF. 14 font standar PDF built-in.
Grafik
Shape (line, rect, circle, ellipse, polygon, star, arrow, curve), gradient (linear, radial, Coons patch mesh, Gouraud triangle mesh), pattern fill, parsing SVG/EPS, dukungan gambar (PNG, JPEG, WebP, AVIF).
Rendering HTML
Parser HTML built-in mendukung div, p, h1-h6, table (colspan/rowspan), list, inline styling. Untuk CSS3 penuh (Flexbox, Grid, web font), gunakan package Artisan.
Barcode
1D: Code 128, EAN-8/13, UPC-A/E, Code 39/93, GS1-128, IMB, dan lainnya. 2D: QR Code (ISO 18004), DataMatrix (ISO 16022), PDF417 (ISO 15438).
Keamanan
Enkripsi AES-256 (AESV3 Rev 6) dengan SASLprep. Tanda tangan digital PAdES B-B dengan tampilan visible/invisible. Client timestamp RFC 3161.
Formulir
Field AcroForm: text, checkbox, radio button, list box, combo box, button. Form flattening.
Navigasi
Bookmark, link internal/eksternal, named destination, anotasi, daftar isi, lampiran file, JavaScript.
Output
Simpan ke file, tampilan inline, download, string buffer. Streaming output untuk dokumen besar. Linearization untuk tampilan web progresif. Mode deterministik untuk reproducible build.
