Skip to content

Print something with python cups. Specially the receipt printers

License

Notifications You must be signed in to change notification settings

ZhengLinLei/cups-python-printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CUPS Python Printer Software

Window users https://github.com/ZhengLinLei/windows-python-printer

Installation

Install wkhtmltopdf in https://wkhtmltopdf.org/downloads.html.

Linux user

sudo apt-get install wkhtmltopdf
# or
sudo apt install wkhtmltopdf

Import the source code to your project, and read the examples.

# aa = PrintFile()

# aa.addFile('./test/test.pdf', 'Test', options = {
#     'page-height': '210mm',
#     'page-width': '80mm',
# })

aa = PrintHTML('./tmp', options = {
    'page-height': '210mm',
    'page-width': '72mm',
    'margin-right': '1mm',
    'margin-left': '1mm',
   'encoding': "UTF-8",

})

aa.addFile('./test/test.html', 'Test', {})

print(aa.options)

aa.choosePrinter(0)


print(aa.printAll())

About

Print something with python cups. Specially the receipt printers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages