简体   繁体   中英

Change font size with cups and python

I print a txt file with cups and python. How do I change the font size?

conn = cups.Connection()
printers = conn.getPrinters()
printer_name = list(printers.keys())[0]
conn.printFile(printer_name,'file.txt','',{})

Try the following, it worked for me...

conn.printFile(printer_name,'file.txt','',{'landscape':'True', 'cpi':'14', 'lpi':'10'})

BTW I added the 'landscape':'True' to show that you can pass additional info in case needed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM