CLI tool for ETH Zurich's webprint service. Upload and print documents from your terminal instead of the web interface.
- Python 3.9+
- Connection to ETH network (VPN or on-campus)
- ETH student account
git clone https://github.com/joshuaswanson/eth-print-cli.git
cd eth-print-cli
pip install .
playwright install chromiumethprint login
ethprint login -u jdoeYour session is saved locally so you don't need to log in every time. Sessions expire after ~24 hours of inactivity.
ethprint print document.pdf
ethprint print slides.pdf --color
ethprint print essay.pdf --simplex --copies 2
ethprint print poster.pdf --media a3ethprint upload file1.pdf file2.pdfThen print from the web UI or the CLI.
ethprint status # check login status and balance
ethprint clear # delete all files from inbox
ethprint logout # end session| Flag | Description |
|---|---|
--copies, -n |
Number of copies (default: 1) |
--color, -c |
Print in color (default: black & white) |
--simplex, -s |
Single-sided printing (default: duplex) |
--media, -m |
Paper size: a4, a3, letter (default: a4) |
--pages, -p |
Page range, e.g. 1-3,5 |
--printer |
Printer name (default: CARD-STUD) |
PDF, HTML, TXT, PS, BMP, GIF, JPEG, PNG, SVG, TIFF
ETH's webprint runs SavaPage, which has a REST API and IPP support for exactly this kind of thing. But ETH has disabled both for student accounts. The Internet Printer settings page just says "No URL available" and the REST API returns 401 regardless of credentials.
So this tool does it the hard way: it uses a headless browser to log in (because SavaPage needs a Wicket-initialized server session that can't be created with plain HTTP requests), then talks to the same internal API endpoints that the web UI uses.
PDFs are also automatically resized to match your target paper size before uploading. If you try to print an A3 PDF on A4, it gets scaled down transparently instead of printing on the wrong paper size or getting cropped.
If you find this useful, buy me a coffee.
