LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-22-2004, 08:03 AM   #1
DeathsFriend
LQ Newbie
 
Registered: Aug 2003
Distribution: Mandrake
Posts: 10

Rep: Reputation: 0
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.
 
Old 03-23-2004, 12:16 AM   #2
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
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.
 
Old 03-23-2004, 04:05 AM   #3
DeathsFriend
LQ Newbie
 
Registered: Aug 2003
Distribution: Mandrake
Posts: 10

Original Poster
Rep: Reputation: 0
Thankyou, Thankyou, Thankyou, Thankyou.

Works like a treat.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing out http request in php abrb220 Programming 1 11-19-2005 02:23 AM
Trouble printing pdf's SlowMindThinkin Linux - Software 1 01-10-2005 03:36 AM
Printing in PHP clau_bolson Programming 4 03-04-2004 05:52 AM
printing through lpr from php Don Lag Programming 3 06-03-2003 12:15 PM
Printing PHP/MySQL generated letters mychl Programming 2 04-18-2003 04:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration