User Contributed Notes Printer functions |
|
kincaic at swbell dot net
22-May-2002 04:23 |
|
The X and Y co-ordinates are in dots.
Get the printer resolution
BEFORE printing anything and convert all co-orditantes to dots in the
current resolution.
Trying to change the resolution does NOT work
in Win2000.
Anybody know where the source to php_printer.dll is
kept? I would like to fix some of the bugs that I have found.
|
|
bertATnerdstockDOTorg
20-Jan-2003 11:22 |
|
If you want to address the printer from your PHP-application in a Un*x
environment: This is possible if you use a different method. In Unix
it would not be logical to address your printer directly from php, but you
could for instance generate a PDF-file with PDFlib (or a textfile, or a
PNG/JPEG image with GD or what have you) and write it from your php-script
to a directory that you use as a "printer-outbox."
Next,
you write a shellscript that calls some unix tool to print all pdf or
other documents in your "outbox" directory and then deletes all
files in that directory.
Then you use crontab to run this script
every minute or as often as you think it's neccessary.
You could of
course also call the shellscript from your php-application with exec() but
you'll probably want to avoid using exec() and the like for security
reasons.
|
|
surak at surak dot eti dot br
04-Feb-2003 05:30 |
|
[Editor's Note]
There is another free one available at
[/Note]
As
Bert said, a pdf generator wouldn't be bad. There is a free one at , which can
do the job. Inspite of the fact it is a little bit rough, it works fine
and quite fast. It's just a matter of throwing the pdf file to ghostscript
print it.
|
|
jwlash at acm dot org
20-Feb-2003 06:40 |
|
I have noticed the for unix based systems you can also do
this:
system("lp $filename")
:)
|
|
HW
04-May-2003 10:31 |
|
Should be pretty obvious, but in case there is any confusion... The
printer in question is one that is connected to the _server_, not the
_client_.
|
|
|