Sign inSign up

rudransh404/ghostscript-printer-app

By rudransh404

Updated over 1 year ago

Containerized Ghostscript Printer App with IPP, USB/network support.

Image
Networking
Operating systems
0

371

rudransh404/ghostscript-printer-app repository overview

ghostscript-printer-app

The ghostscript-printer-app is a containerized Printer Application powered by Ghostscript, designed to provide versatile printing support for a variety of printers. Built on the PAPPL framework for IPP printing and enhanced with cups-filters 2.x, this application excels at rendering PostScript, PDF, and raster data for both legacy and modern printers, all within a portable Docker environment.

Features

  • Ghostscript Rendering: Converts PostScript, PDF, and raster inputs into printer-ready formats using Ghostscript’s robust interpreter.
  • Broad Driver Support: Includes a wide array of printer drivers (e.g., hplip, foo2zjs, brlaser) for compatibility with diverse printer models.
  • PPD Integration: Dynamically loads PPD files for printer configuration and option mapping.
  • Printer Discovery: Supports USB and network printers via CUPS backends, ensuring seamless detection and connectivity.
  • Web Interface: Provides an intuitive UI for printer management and configuration.
  • IPP Compatibility: Maps standard IPP attributes to driver-specific options for universal client support.

Pulling the Image

To pull the image from Docker Hub, run:

sudo docker pull rudransh404/ghostscript-printer-app

Running the Container

Create a persistent Docker volume:

sudo docker volume create ghostscript-printer-app

Run the container:

sudo docker run -d \
    --name ghostscript-printer-app \
    --network host \
    -e PORT=<port> \
    -v ghostscript-printer-app:/var/lib/ghostscript-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    rudransh404/ghostscript-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/ghostscript-printer-app -b rudransh404
cd ghostscript-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:ghostscript-printer-app:latest
Run the Container
sudo docker run -d \
    --name ghostscript-printer-app \
    --network host \
    -e PORT=<port> \
    -v ghostscript-printer-app:/var/lib/ghostscript-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    ghostscript-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: IPP printing framework.
  • qpdf v11.10.1: PDF transformation tool.
  • ghostscript v10.05.0: Core PostScript/PDF rendering engine.
  • cups v2.4.11: Core printing system.
  • libcupsfilters v2.1.1: Print job filtering library.
  • libppd v2.1.0: PPD handling library.
  • cups-filters v2.0.1: Filtering system for print processing.
  • pyppd v1.1.0: PPD compression utility.
  • foomatic-db 20240504: Printer database.
  • hplip v3.22.10+dfsg0-8: HP driver suite.
  • c2050 v0.3-7: Canon driver.
  • cjet v0.8.9-11: Canon BJ printer driver.
  • min12xxw v0.0.9-11: Konica Minolta driver.
  • pnm2ppa v1.13-13: HP PPA driver.
  • c2esp v27-11: Kodak ESP driver.
  • dymo-cups-drivers v1.4.0-12: DYMO driver.
  • foo2zjs v20200505dfsg0-3: ZjStream driver.
  • fxlinuxprint v1.1.0+ds-4: Fuji Xerox driver.
  • m2300w v0.51-15: Minolta driver.
  • printer-driver-oki v1.0.2: OKI driver.
  • pxljr v1.4+repack0-6: HP PXL driver.
  • rastertosag-gdi v0.1-8: Ricoh driver.
  • splix v2.0.1-1: Samsung SPL driver.
  • brlaser v6: Brother driver.
  • ptouch-driver v1.7-1: Brother P-Touch driver.

How It Works

  • Print Processing: Ghostscript renders PostScript, PDF, and raster inputs, passing them to the appropriate driver for output.
  • Printer Discovery: Uses CUPS backends for USB and network printer detection, supporting IPP, LPD, and socket protocols.
  • IPP Mapping: Automatically maps IPP attributes (e.g., print-quality, media) to driver options.
  • Driver Flexibility: Supports a variety of legacy and modern drivers, leveraging foomatic-db and custom filters.

Summary

The ghostscript-printer-app Docker image offers a powerful, containerized printing solution powered by Ghostscript. It supports a wide range of printers through diverse drivers, rendering PostScript, PDF, and raster inputs with ease. With features like IPP compatibility, CUPS-based printer discovery, and a user-friendly web interface, it provides a flexible and modern approach to printing, ideal for both legacy and contemporary workflows.

Tag summary

Content type

Image

Digest

sha256:d38dd6b4a

Size

119.3 MB

Last updated

over 1 year ago

docker pull rudransh404/ghostscript-printer-app