Hi
I have a php file with html forms and variables in php.
I generate a policy document that is displayed in the web page and is then created in PDF and emailed to the client.
I create the PSF via using EZPDF but This runs slow when creating the policy and whenever we have to make changes to the document it becomes a huge mission as each element of the PDF file has to be drawn on X and Y coordinates.
Is there a way that I could print this what is displayed on the web page directly to a PDF?
I have added a little excerpt from my current method below:
HTML File Displayed
<table>
<tr>
<td class="<?php print $Title_error;?>">Title</td>
<td><input name="Title" type="text" id="Title" tabindex=2 style="color: <?php print $TextColour;?>;" value="<?php print $_SESSION['Title'] ;?>" size="30" readonly/></td>
<td class="<?php print $Gender_error;?>">Gender</td>
<td><input name="Gender" type="text" id="Gender" tabindex=5 style="color: <?php print $TextColour;?>;" value="<?php print $_SESSION['Gender'] ;?>" size="30" readonly/></td>
</tr>
<tr>
<td class="<?php print $FirstName_error;?>">First Name</td>
<td><input name="FirstName" type="text" id="FirstName" tabindex=3 style="color: <?php print $TextColour;?>;" value="<?php print $_SESSION['FirstName'] ;?>" size="30" readonly/></td>
<td class="<?php print $Surname_error;?>">Surname</td>
<td><input name="Surname" type="text" id="Surname" tabindex=4 style="color: <?php print $TextColour;?>;" value="<?php print $_SESSION['Surname'] ;?>" size="30" readonly /></td>
PDF Creation
//DETAILS OF MAIN MEMBER
$pdf->filledRectangle(50,740,500,15);
//Set Color to White
$pdf->setColor(255,255,255);
$pdf->addText(230,744,10,"DETAILS OF MAIN MEMBER");
//Set Color back to black
$pdf->setColor(0,0,0);
$pdf->Rectangle(50,720,100,15);
$pdf->addText(93,724,8,"Title");
$pdf->addText(160,724,8,"{$_SESSION['Title']}");
$pdf->Rectangle(300,720,100,15);
$pdf->addText(335,724,8,"Gender");
$pdf->addText(410,724,8,"{$_SESSION['Gender']}");
$pdf->Rectangle(50,700,100,15);
$pdf->addText(80,704,8,"First Name");
$pdf->addText(160,704,8,"{$_SESSION['FirstName']}");
$pdf->Rectangle(300,700,100,15);
$pdf->addText(334,704,8,"Surname");
$pdf->addText(410,704,8,"{$_SESSION['Surname']}");
So As you can see in the pdf create snippet above, If I had to add a new field in between firstName and Surname the whole page's coordinates would have to change, there has to be a better way.