Creating pdf file emailing
I creating a system that need to send invoices in pdf format via mail. i am able to send an email but have problems with creating a PDF from the DB data.
I use Primo for my pdf program...what DB program are you using?
you can use fpdf.org, i'm usinging to email dynamically generated pdf reports to users.
Originally Posted by
Kindly walk me thru how you are doing it. i need to create a pdf from mysql db and email it to the client as an invoice.
Anyone with ideas on how i can create an invoice in pdf using php. i.e draw the table, insert the data and the like
i wrote my php script as i normally would to get the results, then where i have my table headers i also have: <?
$pdf_cols = array("column headers seperated by ,");
$pdf_data = array();
then where my results get displayed i have:
$pdf_data[count($pdf_data)] = array(here your variables here);
at my closing html tag:
$pdf = new PDF("L");
$pdf->SetFont("Arial", "B", 14);
$pdf->Cell(200, 10, "Service Advisor Bonus Amounts", 0, 0, "L");
$pdf->SetFont("Arial", "", 10);
$pdf->Cell(200, 10, "From : ".$StartDate." to ".$EndDate, 0, 0, "L");
$pdf->SetFont("Arial", "", 9);
so when the user runs a report and click submit the pdf file will get created/saved to the pdf folder
then i have a send_mail script that will take that same pdf report and send it to the users.
there are tons of examples on fpdf.org under the scripts link...it's been a while so i don't remember which example i modified.