There is a scripts section at fpdf.org that has an example for filling PDFs dynamically. Here is the script.
<?php
/***************************
Sample using a PHP array
****************************/
require('fpdm.php');
$fields = array(
'name' => 'My name',
'address' => 'My address',
'city' => 'My city',
'phone' => 'My phone number'
);
$pdf = new FPDM('template.pdf');
$pdf->Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8
$pdf->Merge();
$pdf->Output();
?>
First - they reference fpdm.php - i assume that is a mistake, and changed it to fpdf.php, as well as the class reference - so that isn't the source of my error. When I change all that and set up a test - i get an error saying that the "orientation is wrong".
Every other fpdf example has you entering paramaters into the function to set orientation (P or L) as well as size (A4) etc. This one does not. Has anyone messed with this example and gotten it to work? We're using an HTML form on a doctors website to take info and then merging it with their actual forms and outputting them as a PDF for their charts - so a script like this where i can load the whole record in an array and pop them in the fields on the PDF would be fantastic.... if it worked :)
fpdm.php is actually something you have to download right underneath the example.