spacer
Web Development Tutorials PHP Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Easy PDF Generation in PHP

By Akash Mehta
2008-03-01


Hello World with FPDF

Let's get started with some basic PDF generation using FPDF. Load up your code editor and bash out the following:

<?php
require('fpdf.php');
$PDF = new FPDF();

$PDF->AddPage();
$PDF->SetFont('Arial', 'B', 16);
$PDF->Cell(40, 10, 'Hello World!');

$PDF->Output();

I'll explain what all this does in a moment. For now, grab the latest version of FPDF from fpdf.org, extract it to somewhere in your web server's document root and save this snippet in a PHP file under the same folder as fpdf.php. Load it up in your web browser and you should see something like this:

Nothing special, but we're on our way to PDF glory!



Tutorial Pages:
» Introduction
» Why would you want to generate PDFs?
» Options for PDF Generation
» Hello World with FPDF
» Examining the code
» Further reading on FPDF


Related Tutorials:
» Web Database Access from Desktop Applications
» CubeCart 3.0 Installation and Configuration
» PHP Site Search Made Easy
» Installing and Configuring Drupal 6.1
» Desktop Application Development with PHP-GTK
» Installing PHP on Windows



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: