FPDF, a PHP class, enables you to generate PDF files, and doesn’t depend on additional PHP libraries.
Available for free, it can be downloaded from its official website’s download section. Its download package comprises of all the essential files as well as some tutorials on using it.
The package can be uploaded on your MilesWeb account using FTP, or using File Manager in cPanel and extracted it after that. Then place the extracted contents in any folder on your account, which will then get converted into the FPDF installation folder.
The basic example of using FPDF is by using the below PHP code (you should select the FPDF package in the folder where the PHP file with the code is placed):
<?php require(‘./fpdf.php’); $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); ?>
Suppose you have downloaded and extracted the FPDF package within a folder called ~/public_html/fpdf/.
Additionally, you can create a new PHP file called toPDF.php within the same folder and insert the above code. Then save the file and try accessing it through your browser:
After the execution, the PHP script will generate a PDF file in your browser.