1. Go to this page and download the library: Download gablem/aftfpdf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$pdf = new aftFPDF();
$pdf->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true);
$pdf->SetFont('DejaVuSans');
$pdf->AddPage();
// Set an alpha value for the rectangle
$pdf->SetAlpha(0.5);
$pdf->Rect(20, 20, 50, 50, 'F');
// Set an 50% alpha value for the fill, but keep 100% for the stroke
$pdf->SetAlpha(0.5, 1);
$pdf->Rect(40, 40, 50, 50, 'DF');
// Also works with text
$pdf->SetFontSize(64);
$pdf->SetAlpha(0.5);
$pdf->SetTextColor(255, 0, 0);
$pdf->Text(45, 62, "Hello World");
$pdf->SetTextColor(0, 0, 255);
$pdf->Text(46, 63, "Hello World");
$pdf->Output('output.pdf', 'F');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.