Skip to content

pq-software/print-relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintRelay

Allow direct printing without browser dialog. Receive PDF and ESC/P file with an API on http://127.0.45.12:3400/ then sent them to printer.

API

# Query printer
printer = requests.get('http://127.0.45.12:3400/printer').json()['printer'][0]['name']

# Send print job
requests.post('http://127.0.45.12:3400/print', params={ # Query string
    'printer': printer, # printer name from response above
    'type': "escp", # ENUM: escp / pdf
    'job_name': "Work Order #0001", # Meaningful to display to user in print queue
    }, data=pdf_content) # HTTP Body is binary data of pdf or escp

It might need headers: {'Access-Control-Request-Private-Network': true } to make Google Chrome allow sending request to localhost.

Usage

  • Force printer: Force all job to print to the selected printer in the right-hand list
  • Draft Mode: Force dot matrix printer to use draft font
  • Unidirection: Force dot matrix printer to print in one direction, better for table printing, but it will print slower.
  • Dry Run: Don't print. It will display first page content in popup.
  • Start on Boot: Start when Windows boots.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published