You are here: Re: [PHP] Printing « PHP « IT news, forums, messages
Re: [PHP] Printing

Posted by Richard Lynch on 04/06/05 06:15

On Sat, April 2, 2005 9:03 am, Niels Riis Kristensen said:
> I am using a Unix machine (Mac) but can't find ways to print to my
> local printer. Plenty of information about printing from a PC, but none
> from a mac. Can that be, that you can't print from php to mac?

First, get printing to work AT ALL on the machine. If your text editor or
browser can't print, PHP ain't gonna be able to either, most likely.

Next, see if you can figure out what command line is being used to make
things print... Sometimes you can force an error (turn off the printer as
you print) and get something to puke out on the screen or into
/var/log/messages or...

Finally, whatever that command line is, use http://php.net/exec to make it
happen in PHP. You'll also need to be aware of the PHP User and what
their permissions are -- Try to 'su' to that user in a terminal window and
do the command to print from the command line.

Oh yeah: Start with a dirt simple text file:
---------------- test.txt ------
Hello World
--------------------------------

If you can't get that to print, it's unlikely you'll get fancy stuff like
PostScript to work... Though sometimes it goes the other way, and PS
prints fine, but text refuses. Go figure.

In all OSes, I find printer setup the most painful experience for
something that virtually every normal user is supposed to be able to do
this... WHY?!

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация