Skip to content

Hasenzahn1/PrinterWebServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrinterWebServer

A Flask-based print server application that automates the retrieval of images from a Nextcloud instance, applies custom visual overlays, and manages printing tasks via a modern web interface.

Features

  • Nextcloud Integration: Automatically fetches new images and metadata from a specified Nextcloud folder via NextcloudFetcherThread.
  • Web Dashboard: A responsive interface to monitor the current print job, manage the print queue, and view unlisted jobs.
  • Overlay Editor: A built-in visual editor (editor.html) to create, save, and apply JSON-based overlays (text, images, dynamic positioning) to print jobs.
  • Queue Management:
    • Auto-Print: Toggle "Print on Receive" to automatically process incoming files.
    • Manual Control: Pause/Resume the printer and manually trigger prints from the unlisted buffer.
  • Cross-Platform Printing: Supports printing on Windows (via win32print) and Linux (via cups) handled in printing.py.

Prerequisites

  • Python 3.x
  • A Nextcloud instance
  • Linux: CUPS installed (libcups2-dev)
  • Windows: A configured default printer

Installation

  1. Clone the repository

    git clone <repository-url>
    cd PrinterWebServer
  2. Install Dependencies

    pip install -r requirements.txt

    Note: On Windows, this requires pywin32. On Linux, this requires pycups.

  3. Configuration Create a file named config.yml in the root directory. Based on Config.py, it requires the following structure:

    nc_username: "your_username"
    nc_password: "your_password"
    nc_images_folder: "/Photos/PrintQueue"
    nc_metadata_folder: "/Photos/Metadata"
    nc_check_time: 5  # Interval in seconds to check for new files

Usage

  1. Start the Server Run the main entry point:

    python main.py

    This starts the Flask web server and the background threads for the printer manager and Nextcloud fetcher.

  2. Access the Web Interface Open your browser and navigate to: http://localhost:5000

  3. Overlay Editor Navigate to /editor or click the "Overlay Editor" button in the header to create custom print layouts.

Project Structure

  • main.py: Application entry point. Initializes the Flask app and PrintManager.
  • src/: Backend logic.
  • website/: Flask web application.
    • static/: CSS, JavaScript, and assets.
    • templates/: HTML templates (index.html, editor.html).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •