I am trying to fill an existing PDF form with data from MySQL. I have found a lot of resources on generating a PDF using PHP but nothing on populating an existing PDF form from MySQL using PHP.
Any help would be greatly appreciated. Thanks in advanced for your time and help!
MySQL to PHP to PDF
Moderator: General Moderators
-
danielconaghan1
- Forum Newbie
- Posts: 2
- Joined: Fri Apr 28, 2006 9:05 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The problem is that its quite a competetive field at the moment.
I use a php script that creates a pdf object. The object is written by the php then converted to a pdf.
the way html is written by php.Code: Select all
$field ="SELECT * FROM field_data WHERE page_id=" . $page_no;
$field_results = $db->query($field);
while($field_row = mysql_fetch_assoc($field_results)) {
$data=$field_row['text'];
$FormatCode = array("~b->", "<-b~", "~i->", "<-i~","~u->", "<-u~");
$RemovedCode = array("<b>", "</b>", "<i>", "</i>","<c:uline>", "</c:uline>");
$data = str_replace($FormatCode, $RemovedCode, $data);
$size=($field_row['size']*3);
$x1 =($field_row['x1']*$co_change);
$y1 =($docheight - ($field_row['y1']*$co_change));
$ydif = $pdf->getFontHeight($size);
$y1 = $y1 - $ydif;
$width =($field_row['x2']*$co_change);feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]