Revision #29 has been created by rackycz on Oct 2, 2020, 8:53:13 AM with the memo:
TCPDF
« previous (#28) next (#30) »
Changes
Title
unchanged
Yii v2 snippet guide II
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2,snippets
Content
changed
[...]
exit();
```
Note: But exit() or die() should not be called. Read the "DbCreator" link above.
**PDF - UTF + 1D & 2D Barcodes - TCPDF**
---
See part I of this guide for other PDF creators:[...]
```
Now you can use any Example to test TCPDF. For example: https://tcpdf.org/examples/example_001/
**Note:** You have to call constructor with backslash:[...]
```
**Note
that t:** Texts are printed using more methods - see file tcpdf.php for details:
- writeHTMLCell()
- Multicell()[...]
- Text()
**Note:** Store your files in UTF8 no BOM format so diacritics is correct in PDF.
Importing new TTF fonts is done like this:
```php
// this command creates filed in folder _tcpdf\fonts. Use the filename as the fontname in other commands.
$fontname = \TCPDF_FONTS::addTTFfont("path to TTF file", 'TrueTypeUnicode', '', 96);
```
Now you can use it in PHP like this:
```php
$pdf->SetFont($fontname, '', 24, '', true);
```
Or in HTML:
```html
<font size="9" face="fontName" style="color: rgb(128, 128, 128);">ABC</font>
```
Rendering is done like this:
```php
$pdf->writeHTML($html);
```
**New version of TCPDF**
... to be finished ...
- https://github.com/tecnickcom/tc-lib-pdf
- composer require tecnickcom/tc-lib-pdf:dev-master[...]