Is there an alternative to pdflib?
Applies to: Grid System
Instead of using PDFlib, now commercial software, you can use FPDF (FreePDF), which allows you to generate PDF files without using the PDFlib library.
FPDF is installed in Modwest's PHP5 environment at /usr/share/php/fpdf. To get started using FPDF:
- Make sure that your include path in /conf/php.ini is set to /usr/share/php/
include_path = "/usr/share/php/"
- Then, make sure to include the library file in your .php page:
As an example, create and put the following in /htdocs/www/mypdf.php:
AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); exit(); ?>
Going to http://www.yourdomain.com/mypdf.php will now load a PDF in the browser with the text "Hello World!". If you have trouble, please refer to the FPDF FAQ and the FPDF tutorial.
Alternatives to using FPDF:
- Stay in Modwest's older RedHat 7 environment featuring PHP4 (not recommended), and use the formerly non-commerical version of PDFlib.
- Purchase a license to use the current version of PDFlib: http://www.pdflib.com/products/pdflib-family/buy-pdflib, and install it on your Modwest account by following the instructions here.
4259/0%Last update: 2011-12-21 17:13
Author: FAQ Admin
You can comment this FAQ
Comment of Anonymous:
For IE8 to download my PDF successfully, I had to follow the FAQ here, which explains how to disable the Acrobat plug-in: http://www.fpdf.org/en/FAQ.php#q3.
Then I had to open up IE8 and go to Tools >> Internet Options >> Custom Level >> and enable "Automatic prompting for file downloads" under the Downloads section. (All options under the Download section should be enabled.)
Added at: 2009-12-24 12:02