printing

Word Macro for other tray printing

自闭症网瘾萝莉.ら 提交于 2020-07-09 11:34:07
问题 For years our office has been using HP printers and a few Macros in MS Word that add buttons to the toolbar. One prints the job to tray 3 (plain paper), one prints the first page to tray 2 (pre-printed letterhead) and the rest to tray 3, and the last sends the whole job to tray 1 (manual feed for labels etc.). This has all been pretty straight cut to tweak if the printer changed, but now we have replaced all of those HP printers with Canon printers and are using the UFRII drivers... The macro

Window.print() sets default copies to 2

主宰稳场 提交于 2020-07-09 03:55:10
问题 I have a requirement that by clicking on a button, the printer dialog will open with the number of copies set to 2 instead of the default number 1. 回答1: No it is not possible using pure javascript with window.print(). However, if you are open to using Java Applet, take a look at qz-print aka jzebra. I have personally used this in some past projects for some advance printing requirements and the result is very satisfying. Take a look at their printHTML() method ********************************

String alignment does not work with ansi colors

家住魔仙堡 提交于 2020-07-08 11:59:30
问题 Facing this issue with Python: a = "text" print('{0:>10}'.format(a)) # output: text b = "\x1b[33mtext\x1b[0m" print('{0:>10}'.format(b)) # output: text As you can see the right-justification stopped working once the coloring tags get added to the text. The second "text" should be indented as the first one, but it was not. 回答1: This is to be expected because the data is already longer than your field width: >>> len(b) 13 >>> len('{0:>10}'.format(b)) 13 To see a workaround, check here: Printed

String alignment does not work with ansi colors

风格不统一 提交于 2020-07-08 11:58:28
问题 Facing this issue with Python: a = "text" print('{0:>10}'.format(a)) # output: text b = "\x1b[33mtext\x1b[0m" print('{0:>10}'.format(b)) # output: text As you can see the right-justification stopped working once the coloring tags get added to the text. The second "text" should be indented as the first one, but it was not. 回答1: This is to be expected because the data is already longer than your field width: >>> len(b) 13 >>> len('{0:>10}'.format(b)) 13 To see a workaround, check here: Printed

Is it possible to print without using the print function in Python?

倖福魔咒の 提交于 2020-07-03 08:09:56
问题 I wondered whether it is possible to print (for example a string) in Python without the print function. This can be done by a command or by some trick. For example, in C there are printf and puts . Can someone show me a way to print or to deny this possibility? 回答1: sys.stdout.write("hello world\n") 回答2: import sys sys.stdout.write("hello") 回答3: You can use sys.stdout.write() Sometimes I find sys.stdout.write more convenient than print for printing many things to a single line, as I find the

Is it possible to print without using the print function in Python?

♀尐吖头ヾ 提交于 2020-07-03 08:09:14
问题 I wondered whether it is possible to print (for example a string) in Python without the print function. This can be done by a command or by some trick. For example, in C there are printf and puts . Can someone show me a way to print or to deny this possibility? 回答1: sys.stdout.write("hello world\n") 回答2: import sys sys.stdout.write("hello") 回答3: You can use sys.stdout.write() Sometimes I find sys.stdout.write more convenient than print for printing many things to a single line, as I find the

Is it possible to print without using the print function in Python?

一个人想着一个人 提交于 2020-07-03 08:08:19
问题 I wondered whether it is possible to print (for example a string) in Python without the print function. This can be done by a command or by some trick. For example, in C there are printf and puts . Can someone show me a way to print or to deny this possibility? 回答1: sys.stdout.write("hello world\n") 回答2: import sys sys.stdout.write("hello") 回答3: You can use sys.stdout.write() Sometimes I find sys.stdout.write more convenient than print for printing many things to a single line, as I find the

Printer Driver - custom paper size

拥有回忆 提交于 2020-06-29 01:43:42
问题 I'm working on custom printer V3 driver. The current task is to give ability to create custom paper size to user. I google it a bit and found 2 ways of doing that: 1) CUSTOMSIZE option in GPD file. I've added this to my GPD file: *Option: CUSTOMSIZE { *rcNameID: =USER_DEFINED_SIZE_DISPLAY *MinSize: PAIR(4724, 6992) *MaxSize: PAIR(14032, 20410) *MaxPrintableWidth: 14032 *MinLeftMargin: 0 *CenterPrintable?: FALSE *Command: CmdSelect { *Order: PAGE_SETUP.2 *Cmd: "" } } , but could not find where

How to print with landscape orientation in PyQt5?

六眼飞鱼酱① 提交于 2020-06-28 02:03:59
问题 How can I modify this code to print automatically with, or to set default settings to landscape orientation? I'm new to PyQt5. Trying to make an app with printing function. I copy+pasted this code from the internet but it's default setting is portrait orientation. It would be important to print with landscape orientation automatically. from PyQt5 import QtWidgets, QtCore, QtPrintSupport, QtGui class Window(QtWidgets.QWidget): def __init__(self): QtWidgets.QWidget.__init__(self) self

How to print with landscape orientation in PyQt5?

孤人 提交于 2020-06-28 02:03:22
问题 How can I modify this code to print automatically with, or to set default settings to landscape orientation? I'm new to PyQt5. Trying to make an app with printing function. I copy+pasted this code from the internet but it's default setting is portrait orientation. It would be important to print with landscape orientation automatically. from PyQt5 import QtWidgets, QtCore, QtPrintSupport, QtGui class Window(QtWidgets.QWidget): def __init__(self): QtWidgets.QWidget.__init__(self) self