michaelrsweet / hp-printer-app

Example printer application for HP PCL printers using PAPPL.
Apache License 2.0
35 stars 7 forks source link

HP Printer Application

Version Apache 2.0

hp-printer-app implements printing for a variety of common PCL printers connected via network or USB. Features include:

Note: Please use the Github issue tracker to report issues or request features/improvements in hp-printer-app:

https://github.com/michaelrsweet/hp-printer-app/issues

Requirements

hp-printer-app depends on:

Installing

hp-printer-app is published as a snap for Linux. Run the following command to install it and start the server:

sudo snap install core         (if you haven't already done so)
sudo snap install avahi        (some Debian-based distros)
sudo snap install hp-printer-app
sudo snap connect hp-printer-app:raw-usb
sudo snap start hp-printer-app.hp-printer-app-server

A package file is included with all source releases on Github for use on macOS 10.14 and higher for both Intel and Apple Silicon.

If you need to install hp-printer-app from source, you'll need a "make" program, a C99 compiler (Clang and GCC work), the CUPS developer files, and the PAPPL developer files. Once the prerequisites are installed on your system, use the following commands to install hp-printer-app to "/usr/local/bin":

make
sudo make install

You can change the destination directory by setting the prefix variable on the second command, for example:

sudo make prefix=/opt/hp-printer-app install

Basic Usage

hp-printer-app uses a single executable to perform all functions. The normal syntax is:

hp-printer-app SUB-COMMAND [OPTIONS] [FILES]

where "SUB-COMMAND" is one of the following:

You can omit the sub-command if you just want to print something, for example:

hp-printer-app somefile.pcl

The options vary based on the sub-command, but most commands support "-d" to specify a printer and "-o" to specify a named option with a value, for example:

See the hp-printer-app man page for more examples.

Running the Server

Normally you'll run hp-printer-app in the background as a service for your printer(s), either using the Snap package or the systemd service file:

sudo systemctl enable hp-printer-app.service
sudo systemctl start hp-printer-app.service

You can start it in the foreground with the following command:

sudo hp-printer-app server -o log-file=- -o log-level=debug

Root access is needed on Linux when talking to USB printers, otherwise you can run hp-printer-app without the "sudo" on the front.

On macOS you run the "HP Printer Application" program from the launcher, either manually or as a login item. An icon is shown in the menu bar that provides access to the web interface and printers.

Supported Printers

The following printers are currently supported:

Standards

Through PAPPL, hp-printer-app implements PWG 5100.14-2013: IPP Everywhere™ for each printer, and has a partial implementation of PWG 5100.22-2019: IPP System Service v1.0 for managing the print queues and default printer.

Legal Stuff

The HP Printer Application is Copyright © 2019-2024 by Michael R Sweet.

This software is licensed under the Apache License Version 2.0. See the files "LICENSE" and "NOTICE" for more information.