How openprinting/hplip-printer-app works
Purpose and entry points
This is a C-based IPP Printer Application that exposes HPLIP-supported HP/Apollo printers as driverless IPP printers while internally retaining HPLIP’s PPD, filter, and backend stack. The executable and main integration point are hplip-printer-app.c and its installed service definition hplip-printer-app.service. It runs as an interactive CLI/server and provides PAPPL’s web administration UI, normally on port 8000.
Application host and printer model integration
hplip-printer-app.c configures PAPPL and pappl-retrofit to turn classic HPLIP PPD drivers into a long-running Printer Application. HPLIP PPDs supply supported-model metadata, capabilities, and vendor options; only hpcups PPDs are relevant. At runtime, PPD lookup can be overridden with PPD_PATHS, separating application logic from packaged or local driver assets.
Grounding: hplip-printer-app.c, Makefile, testpage.ps.
Job processing pipeline
Clients submit IPP jobs—directly or through CUPS/cups-browsed—to PAPPL. pappl-retrofit maps IPP attributes to PPD options, including algorithmic selection of color, quality, and content-optimization settings. PDF/PostScript is rendered through Ghostscript when needed; raster inputs are adapted to the printer color space/resolution and passed to HPLIP’s hpcups filter. HPLIP’s hp backend delivers the resulting job to hardware.
Grounding: hplip-printer-app.c, Makefile.
Discovery and device-transport boundary
HPLIP discovery is intentionally separate from PAPPL: the hp CUPS backend handles USB discovery and communication, while the HP wrapper makes HPLIP’s hp-probe behave like a discovery-only CUPS backend for network devices. CUPS standard backends are also exposed as alternatives, enabling USB quirks plus socket, IPP/IPPS, LPD, and configurable SNMP paths. The HPLIP backend is important for IEEE-1284.4 USB behavior and special device functions.
Grounding: HP, hplip-printer-app.c, scripts/run-avahi.sh.
Service lifecycle and deployment wrappers
The system service starts the application as a server daemon. Snap-specific launch wrappers distinguish normal application execution from server startup. The container startup script selects an optional PORT; persistent application state is mounted externally, and host networking/USB access are required for full network discovery and USB printing.
Grounding: hplip-printer-app.service, snap/local/run-hplip-printer-app, snap/local/run-hplip-printer-app-server, scripts/start-server.sh.
Packaging and runtime infrastructure
Two deployable runtimes are defined: Snap and OCI Rock. snap/snapcraft.yaml assembles the confined Snap, including HPLIP sourced from Debian packaging; rockcraft.yaml builds the OCI image. Both package or depend on PAPPL, pappl-retrofit, cups-filters/libppd, CUPS backends, Ghostscript, and HPLIP. Local patches adjust CUPS DNS-SD socket behavior and HPLIP plugin/library loading for packaged environments.
Grounding: snap/snapcraft.yaml, rockcraft.yaml, patches/cups-dnssd-backend-socket-only.patch, patches/hplip-plugin-firmware-load-path.patch.
External services and extension points
PAPPL provides IPP, web UI, and printer-application lifecycle; Avahi/DNS-SD supports service/discovery networking; HPLIP provides driver, PPD, discovery, transport, and optional proprietary-plugin support. The app can install HPLIP’s proprietary plugin through its UI, enabling firmware-dependent or proprietary-format printers. CI, automated dependency/version updates, and registry publication are implemented through GitHub Actions.
Grounding: .github/workflows/ci.yml, .github/workflows/auto-update.yml, .github/workflows/registry-actions.yml.
Main entry points: hplip-printer-app.c HPLIP Printer App · ci.yml CI & Registry Publishing · snapcraft.yaml Snap Runtime · rockcraft.yaml OCI Rock Runtime
Components 18
Printer Application
- HPLIP Printer App · Long-running driverless IPP printer application.
hplip-printer-app.c - PAPPL · Provides IPP, web administration, and lifecycle.
- pappl-retrofit · Adapts classic PPD drivers to IPP printers.
- hpcups PPDs · Model capabilities and vendor options; lookup supports PPD_PATHS.
Job Processing
- IPP-to-PPD Mapping · Selects color, quality, and content optimization.
- Ghostscript Rendering · Renders PDF/PostScript when required.
- Raster Adaptation · Matches printer color space and resolution.
- hpcups Filter · Processes raster jobs using HPLIP driver logic.
Discovery & Transport
- hp Backend · Handles USB discovery, special functions, and delivery.
- HP Discovery Wrapper · Exposes hp-probe as network discovery only.
HP - CUPS Backends · Supports socket, IPP/IPPS, LPD, and SNMP paths.
- Avahi / DNS-SD
scripts/run-avahi.sh
Deployment
- System Service · Starts the application as a server daemon.
hplip-printer-app.service - Snap Runtime · Uses separate normal and server launch wrappers.
snap/snapcraft.yaml - OCI Rock Runtime · Supports PORT selection and externally mounted state.
rockcraft.yaml - CI & Registry Publishing · Builds, updates dependencies, and publishes artifacts.
.github/workflows/ci.yml
Other components
- IPP Clients · Direct clients or CUPS/cups-browsed submit jobs.
- HP/Apollo Printers
Connections 20
- System Service → HPLIP Printer App: starts
- Snap Runtime → HPLIP Printer App: launches
- OCI Rock Runtime → HPLIP Printer App: runs
- IPP Clients → PAPPL: submits IPP jobs
- HPLIP Printer App → PAPPL: configures
- HPLIP Printer App → pappl-retrofit: integrates
- pappl-retrofit → hpcups PPDs: reads capabilities
- PAPPL → IPP-to-PPD Mapping: dispatches jobs
- pappl-retrofit → IPP-to-PPD Mapping: maps attributes
- IPP-to-PPD Mapping → Ghostscript Rendering: PDF/PostScript
- IPP-to-PPD Mapping → Raster Adaptation: raster input
- Ghostscript Rendering → Raster Adaptation: produces raster
- Raster Adaptation → hpcups Filter: printer-ready raster
- hpcups Filter → hp Backend: sends job
- hp Backend → HP/Apollo Printers: USB/device delivery
- HP Discovery Wrapper → hp Backend: uses hp-probe
- CUPS Backends → HP/Apollo Printers: network transports
- PAPPL → Avahi / DNS-SD: advertises services
- CI & Registry Publishing → Snap Runtime: builds/publishes
- CI & Registry Publishing → OCI Rock Runtime: builds/publishes