|
3 months ago | |
---|---|---|
nbproject | 3 months ago | |
LICENSE.md | 3 months ago | |
README.md | 3 months ago | |
print.php | 3 months ago |
A simple script that accepts a PDF file over HTTP and prints it.
Usage:
print.php?action=list
: Returns a JSON list of available printers.
{"printers": ["canon-123", "brother-etc"]}
print.php?action=print&printer=[printername]
: Print a PDF to the specified printer. The request body shall contain the PDF document.
curl --data-binary "@/home/user/test.pdf" "http://localhost/print.php?action=print&printer=brother-etc"
{"printed": true}
Requires lp
, lpstat
, and pdfinfo
commands to be available.