Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fpdf 1

Status
Not open for further replies.

Bertiethedog

Programmer
Feb 8, 2007
118
GB
At the moment I get a string out of fpdf to pass on to phpmailer.

$pdfstring = $pdf->Output("","S");

This all works fine with a lot of help from yourselves.

My customer wants a screen that gives him the option of printing or sending as an email or both.

I am unable to write local files because of a permissions problem, and if it wont work on my machine my customers machines are a completly unknown quantity & 250 miles away.

Is it possible to print the string then send an eMail?

Your ideas would be greatly appreciated.



Richard
 
is it possible to print the string and send an email

yes.

Code:
$pdfstring = $pdf->Output("","S"); 

sendToBrowser($pdfstring);
sendtoEmail($pdfstring);

function sendToBrowser($pdfstring){
header('Content-type: application/pdf');
header('Content-length:'.strlen($pdfstring));
echo $pdfstring;
}

function sendtoEmail($pdfString){
 //whatever you normally do 
 //just make sure you do not echo ANYTHING AT ALL to the screen.
}

 
Absolutly brilliant

As you can see I am not an expert on PHP (but I am trying)

Kind regards

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top