phpprintipp â€” A command line interface to talk to IPP print servers
--abanner ] [
--bbanner ] [
--file ] [
--host ] [
--job uri] [
--mediatype ] [
--port ] [
--printer ] [
--sides ] [
--tempdir ] [
phpprintipp is a php CLI interface to print servers.
It uses PHP classes located in /usr/share/php/printipp.
Combined together with foomatic-rip, it allows to print to network IPP printers/servers without needing of a spooler on your system.
phpprintipp has following options:
the banner sheet to print after job
the banner sheet to print before job
Display credits and licence then exit.
number of document copies to print
path, relative or absolute, to a printable file
Will print the file name if it is unreadable
resolvable hostname/FQDN, or ipV4/V6 IP
--job "job uri"
get job attributes for this job
display the printed job attributes
default to /dev/null
the mime media type of the file provided to your printer (default to application/octet-stream). most printers allows only that type and "text/plain".
do not handle http exceptions
do not handle ipp exceptions
print (from pipe or standard input), overridden by
the printer password, if needed
comma separed list of the four destinations as above (the cups default)
--port "port number"
default to IPP standard port (631)
--printer "printer uri"
mandatory if not set in rcfile (IPP standard...)
more often the "printer queue" name
get printer attributes
server: load options from "rcfile"
$HOME/.printipp/rcfile if not found
By default, if you do not ask for
--server, phpprintipp will try to load
'default' file from the relevant
1 for one-sided (default), 2 for two-sided, 2CE for two-sided on short edge
default is /tmp
You need a valid directory path, as file/string is streamed to a temp-file, then streamed from the last (allow large files printing, to pass round the PHP "set_memory_limit" directive
your user name, from printer point of view
Each server or network printer given by
myserver needs an rcfile, located (in search order) in:
The rcfile format is variable = "value". Blank lines and lines beginning with a "#" are ignored.
Here is a sample (complete) file
debug = false // false or 0 to 5 (5 = less verbose) username = guest password = verysecret // set it if you need authentication host = "localhost" server_type = CUPS printer = "ipp://localhost:631/printers/reseauipp"; paths = false # => the PrintIPP defaults (CUPS compliant) # example: paths = "/root,/admin,/printers,/jobs" get_printer_attrs = false print = false get_job_attrs = false port = 631 mediatype = "text/plain" logfile = "/tmp/phpprintipp_log" handle_http_exceptions = true handle_ipp_exceptions = true tempdir = "/tmp"
rcfiles settings are overriden by command-line options
echo -e \ 'test\r\nThe quick brown fox jumps over the lazy dog.\f\0027' | \ phpprintipp -p --server myprinter --mediatype 'text/plain'
assuming rasterfile is in a format compliant with your printer:
phpprintipp --server myprinter \ --mediatype 'application/octet-stream' \ --file /path/to/rasterfile
assuming you have foomatic installed and
/etc/foomatic/direct/epson.ppd with directive
cat " in, and
/etc/printipp/TE100 rcfile as above, you can type:
foomatic-rip -P epson /path/to/file.ps | phpprintipp -p --server TE100
Same as above, and using graphicsmagic to convert a png file:
gm convert ~/Artwork/Gnu/gnu.png eps:- | foomatic-rip -P epson | \ phpprintipp -p --server TE100
Printers configuration files given by
, scanned for in (in order):
/usr/share/php/printipp/ and its
Copyright 2005-2008 Thomas Harding.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.