I need to know how to generate pdf files from the php code
I need to know how to generate pdf files from the php code
William Cross
Web Development by Those Damn Coders
Firearm Friendly Websites because our constitution matters
[mod note: scraped from but not attributed to, or even linked to DevZone >> PDF Generation ]
<edit>
scraped content removed so post could come out of moderation
</edit>
Last edited by weegillis; 06-28-2012 at 08:14 PM. Reason: wiped post but kept link
FPDF is a PHP class that allows you to generate PDF files without using the PDFlib library.
FPDF is free and can be downloaded from the official website's download section . The download package contains all necessary files, along with some tutorials on how to use it.
A basic example of using FPDF is with the following PHP code (you must download and extract the FPDF package in the folder where the PHP file with the code is located):
<?php
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
Last edited by weegillis; 03-22-2012 at 08:53 PM. Reason: Add link to post
You can use the simple PHP 5 class of PDFlib that's provided to make a as many PDFs in whatever format you need.
you can also use the below site for reference, this will help you a lot
Create PDF file with PHP
Last edited by weegillis; 06-28-2012 at 08:20 PM. Reason: Activate link. Though late, it provides another perspective so this bump will get a pass.
Thx kyathi , I used FPDF and It worked vey well