Thanks Pierre and MRAB.
I tried that; here is a hex dump of my concatenated file:


16:09:12 R:\DSPR>dump ShortDocument3.txt
File ShortDocument3.txt Size 60 (hex 3C) bytes
00000000:  54 68 69 73 20 69 73 20 74 68 65 20 66 69 72 73  |This is the firs| 00000010:  74 20 64 6F 63 75 6D 65 6E 74 2E 0D 0A 0C 54 68  |t document...♀Th| 00000020:  69 73 20 69 73 20 74 68 65 20 73 65 63 6F 6E 64  |is is the second| 00000030:  20 64 6F 63 75 6D 65 6E 74 2E 0D 0A              | document...    |


but no dice; it printed the whole thing on one sheet, with the form feed printed as a
thick-headed up-arrow character at the start of the second line.
It's looking as if it will only switch sides when the first side is full.
Best wishes
Rob Cliffe


On 27/08/2026 15:42, MRAB wrote:
On 27/08/2026 13:08, Rob Cliffe via Python-list wrote:
I have a Windows 11 laptop and an Epson WF-4820 printer.
Is there any way I can programmatically print two files, one on each side of the same sheet of paper?
The following program doesn't quite work (Python 3.13.3):

[snip]
What happens:
It prints the first file on one side of a sheet, then sucks the sheet back in and prints nothing on the other side.
(Nothing, because the document is short and fits on one side).
Then ejects the paper.
Then does the same thing with the other file.
In other words each file is printed (separately) in duplex mode,
but they are not printed on the same sheet.

If what I want is possible (from my research so far I'm  getting the impression that it isn't) can I do the same thing with image files (print two on opposite sides of the same sheet) ?
If they are both plain text files, you could try concatenating them into one file with a Form Feed character (chr(12) or "\f") between them and then print that.

--
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to