Forum Moderators: coopster
LaTeX is a great way to set really beautiful documents. Create the LaTeX source with PHP [php.net], then run LaTeX and convert the DVI file to PDF.
Andreas
system("latex $user.l.tex > $user.l.log2 2>&1");
system("latex $user.l.tex >> $user.l.log2 2>&1");
system("dvipdfm -e -v $user.l.dvi >> $user.l.log2 2>&1");
This will run LaTeX twice (sometimes necessary when using longtables or indices) and then use dvipdfm to convert the DVI file to PDF.
Andreas
From the FPDF-Website:
FPDF is a PHP class which allows to generate PDF files with straight PHP, that is to say without using the PDFlib library. The advantage is that the latter requires a fee for a commercial usage. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.
With FPDF it's easy to create PDF files from within a PHP script:
define('FPDF_FONTPATH','../fpdf151/font/');
require('../fpdf151/fpdf.php');
$pdf=new FPDF();
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->Text(20,20,'FPDF-Demo');
$pdf->Image('logo.jpg',20,50,40);
$pdf->Output();
I was using HTMLDOC only for tests, but the output was looking very nice. If you have access to your web server to compile and install HTMLDOC, I would use the latter one. If not, you're limited to FPDF or something similiar.
But be sure to notice the difference:
FPDF creates PDF from scratch within a PHP script whereas HTMLDOC is a standalone HTML-to-PDF converter.
[edited by: jatar_k at 4:14 pm (utc) on April 14, 2003]
[edit reason] delinked [/edit]