LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Printing PDF's from PHP (https://www.linuxquestions.org/questions/programming-9/printing-pdfs-from-php-160903/)

DeathsFriend 03-22-2004 08:03 AM

Printing PDF's from PHP
 
I have a small PHP script which generates customised letters from a MySQL database. I would like to convert these letters into PDF, and then print them on the server's printer (not the clients - I don't want the user's computer involved in the printing at all).

I know I use FPDF (http://www.fpdf.org/ ) to generate the PDF, and that part of the code works. My question (and problem) is printing the PDF file it generates on the server's printer; I don't want to send it to the client.

Any ideas guys ? I want to get this done as quick as possible, so any suggestions would fantastic (and you be perfectally honest, this script is annoying the hell outta me!!).

Thanks for your help in advance!
DeathsFriend.

jinksys 03-23-2004 12:16 AM

consider this code...
Code:

...        // PDF constructed with handle $pdf_document
$destfile="letter.pdf";
$pdf_document->Output($destfile, "F");
exec("lpr $destfile");

cups has built in support for printing pdf files, so this code could help you.

DeathsFriend 03-23-2004 04:05 AM

Thankyou, Thankyou, Thankyou, Thankyou.

Works like a treat.


All times are GMT -5. The time now is 09:03 PM.