PDF generater in PHP tutorial

php pdf

PHP PDF Generate tutorial

Here is the tutorial for php pdf creation.
For this you need to download a file called fpdf.php

Basic Code to generate pdf in php

Take a look at the code, First you need to include the fpdf.php file using require() function.
after requiring the library file, we instantiate an object of the FPDF class and call it $pdf.
Then we add a page with the AddPage method, set our output font, define the cell (location) for our string of output, and then—using the Output method—display the PDF in the browser.
Output for the above code will be
php pdf

PHP PDF generate using cell

In the above code we’ve used cell method.
For the first text “PHP – The Good Parts!” we’ve given x=10 and y=10 and 0,0,’L’ denotes column, row and text alignment respectively.
So the output will be
php pdf

NOTE:

You may want to disable your browser’s caching capabilities while you are developing and testing the layout of your FPDF PDFs because some browsers will not reload the page with changes if the changes are so small that they don’t register as such with the cache control.

Attachments

1) FPDF.php

0 comments:

Post a Comment

www.comhttp.blogspot.in. Powered by Blogger.