Skip to content

downace/go-print-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Print Server

A simple HTTP printing server.

Main purpose is to allow fast and silent printing from any device in local network

Two variants available: CLI app and desktop app with GUI.

GUI app is built using Wails 2 and Vue 3 with Quasar.

Supported Platforms

  • Linux - supported using lp and lpstat
  • Windows - supported using wmic and embedded SumatraPDF
  • macOS - not supported (PR's are welcome)

Usage

Download suitable binary from Releases and start it.

For CLI version, use *-cli binary, e.g. print-server-linux-v0.7.0-cli.
Use -help flag to see available options.

You can also build manually from sources

Server API

  • GET /printers - get list of available printers

    curl http://127.0.0.1:8888/printers
    {"printers": [{"name":"Brother_MFC_L2700DN_series"},{"name":"PDF"}]}
  • POST /print-pdf - print PDF file

    curl --header 'Content-Type: application/pdf' --data-binary /path/to/file.pdf http://127.0.0.1:8888/print-pdf?printer=Brother_MFC_L2700DN_series
  • POST /print-pdf-url - print PDF file from URL

    curl http://127.0.0.1:8888/print-pdf-url?printer=Brother_MFC_L2700DN_series&url=https%3A%2F%2Fpdfobject.com%2Fpdf%2Fsample.pdf
  • POST /print-url - print any file from URL

    Loaded file is converted to PDF with Rod which uses Chromium by default. First call to this method may take some time as Chromium needs to be loaded

    Query params: see PrintFromUrlQuery in internal/server/handlers.go

    curl http://127.0.0.1:8888/print-pdf-url?printer=Brother_MFC_L2700DN_series&url=https%3A%2F%2Fhttpstat.us%2F&pages=2-7

Development

GUI app

First, Install Wails CLI

Run Development mode:

wails dev

Build the app:

wails build

CLI

Use cli tag to compile and run CLI app:

go build -tags cli
go run -tags cli .

About

A simple HTTP printing server

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •