Sign inSign up

rudransh404/ps-printer-app

By rudransh404

Updated over 1 year ago

Containerized PostScript Printer App with PPD support, USB/network access, and web-based management.

Image
Networking
Operating systems
1

285

rudransh404/ps-printer-app repository overview

ps-printer-app

The ps-printer-app Docker image provides a containerized PostScript Printer Application. It serves as a retro-fit Printer Application for classic CUPS drivers, utilizing cups-filters 2.x filter functions and supporting PPD-based PostScript printers. This ensures seamless printing capabilities while leveraging modern containerization benefits.

Features

  • PostScript-based Printing: Converts input data (PostScript/PDF) directly into high-level PostScript format without intermediate rasterization.
  • PPD Support: Uses PPD files for printer configuration, enabling automatic option selection and additional feature support.
  • USB and Network Printer Access: Allows access to both USB-connected and network-discovered printers.
  • Filter Chain Processing: Ensures optimal job processing through cups-filters 2.x functions.
  • Web-Based Administration: Provides an intuitive web interface for printer configuration and management.

Pulling the Image

To pull the image from Docker Hub, run:

sudo docker pull rudransh404/ps-printer-app

Running the Container

Create a persistent Docker volume:

sudo docker volume create ps-printer-app

Run the container:

sudo docker run -d \
    --name ps-printer-app \
    --network host \
    -e PORT=<port> \
    -v ps-printer-app:/var/lib/ps-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    rudransh404/ps-printer-app:latest
Parameters:
  • PORT (optional): Specifies the port for the printer app. Defaults to 8000 (or increments if unavailable).
  • --network host: Required for discovering network printers.
  • -v /dev/bus/usb:/dev/bus/usb:ro: Grants read-only access to USB devices.
  • --device-cgroup-rule='c 189:* rmw': Ensures USB access permissions.

Setting Up Locally

To build and run locally:

git clone https://github.com/rudra-iitm/ps-printer-app -b rudransh404
cd ps-printer-app
Prerequisites

Install Rockcraft:

sudo snap install rockcraft --classic
Build the Rock Image
rockcraft pack -v
Convert to Docker Image
sudo rockcraft.skopeo --insecure-policy copy oci-archive:<rock_image> docker-daemon:ps-printer-app:latest
Run the Container
sudo docker run -d \
    --name ps-printer-app \
    --network host \
    -e PORT=<port> \
    -v ps-printer-app:/var/lib/ps-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    ps-printer-app:latest

Web Interface Setup

Access the web UI at:

http://localhost:<port>/

From the interface, you can:

  • Add a printer.
  • Select the discovered printer.
  • Configure settings (driver selection, media options, etc.).

Included Components

  • pappl v1.4.8 – Printer application framework.
  • qpdf v11.10.1 – PDF transformation and optimization.
  • ghostscript v10.05.0 – PostScript/PDF interpreter.
  • cups v2.4.11 – Common UNIX Printing System.
  • cups-filters v2.0.1 – Filtering system for non-PostScript printers.
  • libcupsfilters 2.1.1 – CUPS filtering support library.
  • libppd 2.1.0 – PPD handling library.
  • pyppd 1.1.0 – PPD compression.
  • foomatic-db 20240504 – Printer database.
  • hplip 3.22.10 – HP Linux Imaging and Printing drivers.

How It Works

Key Functionality
  • Uses cups-filters 2.x for efficient print processing.
  • Lists and loads PPD files dynamically for supported printers.
  • Inserts PostScript code based on PPD configurations.
  • Prevents raw job pass-through to ensure correct processing.
  • Supports IPP attributes mapping for seamless client compatibility.
  • Allows PPD file uploads to extend printer support.
  • Uses CUPS backends for discovery, ensuring network printer compatibility.
  • Enables IEEE-1284 ID-based printer identification.
  • Supports automatic hardware accessory detection.
  • Uses filter chains for optimized print job execution.
Printer Discovery and Management
  • Uses CUPS backends for printer detection.
  • Supports manual printer addition for custom network setups.
  • Provides an SNMP backend configuration.

Summary

This Dockerized PostScript Printer Application is a powerful and flexible solution for managing PostScript printers in a containerized environment. It simplifies installation, configuration, and maintenance while leveraging modern printing frameworks and legacy compatibility features.

Tag summary

Content type

Image

Digest

sha256:d677af7ee

Size

120.7 MB

Last updated

over 1 year ago

docker pull rudransh404/ps-printer-app