简体   繁体   English

使用杯子和 python 更改字体大小

[英]Change font size with cups and python

I print a txt file with cups and python.我用杯子和 python 打印一个 txt 文件。 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顺便说一句,我添加了'landscape':'True'以表明您可以在需要时传递其他信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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