Revision #215 has been created by rackycz on Aug 5, 2020, 9:34:46 AM with the memo:
FPDF
« previous (#214) next (#216) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
xdebug.remote_port = 9000
xdebug.remote_autostart=on
```
Quotes were not important. I didnt even need to [download](https://xdebug.org/download) current version of xdebug, it was already in folder C:\xampp\php\ext.
**PDF**
---
For creating PDFs I use [FPDF](http://www.fpdf.org) library. It it extremely simple to make it run. Just download it and then use it as a helper - I described how this is done [above](https://www.yiiframework.com/wiki/2552/yii-v2-snippet-guide#creating-your-new-helper-class).
You will only need **FPDF.php** and folder **font**. Then in your controller just do this:
```php
use myHelpers\FPDF;
// ...
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output('D', 'hello.pdf');
```
Note: I renamed original file fpdf.php to FPDF.php