this post was submitted on 11 Nov 2023
22 points (100.0% liked)

Linux

48040 readers
1300 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'll need to mirror print stuff regularly (flip across the vertical axis), and I'm trying to make the process convenient.

The manual way to mirror print would be by invoking lp, e.g.

lp -o mirror myfile.pdf

Invoking lp would work for images, PDF, ps etc. But but for application (open office draw) files. Unfortunately, I don't see an obvious way to mirror print within the application itself.

I'm thinking of setting up a mirror printer in CUPS that would automatically apply the -o mirror to any documents that hit it.

I suspect this would require some tinkering with CUPS filters - I'll dig into it sometime.

I can't be the only one who's needed this at some point in time.

Has anyone here done something similar? Looking forward to your thoughts!

top 3 comments
sorted by: hot top controversial new old
[–] GravelPieceOfSword@lemmy.ca 2 points 1 year ago* (last edited 1 year ago) (1 children)

Mission Accomplished! My printer driver now has a MirrorPrint Option, and selecting it enables Mirror Printing. For convenience (since I don't see a client side option to flip mirror printing), I have a doppleganger of my regular printer, and I named it MirrorTest - screenshot below. When I need a mirror print, I just send it to the mirror printer.

Actual Changes

Here's the relevant excerpt (added) in /etc/cups/ppd/MirrorTest.ppd (I added this UI option right below the Toner option). Excerpt adds a MirrorPrint Toggle (boolean) to the printer defaults setup. When enabled - the printer will print in mirror mode.

*%=== Mirror Printing ================================
*OpenGroup: General
*OpenUI *MirrorPrint/Mirror Print: Boolean
*OrderDependency: 110 AnySetup *MirrorPrint
*DefaultMirrorPrint: True
*MirrorPrint True/MirrorPrint: "<>setpagedevice"
*MirrorPrint False/Normal: ""
*CloseUI: *MirrorPrint

For further convenience (making sure that a new printer installation didn't mess up my custom changes, I also updated the relevant ppd file in /usr/share/cups/model/. Whenever you add a new printer - CUPS will use the corresponding model ppd as a base, and it will apply any settings changes from configuring default to the copied ppd file in /etc/cups/ppd/your_printer.ppd.

Hope this helps if someone else is also looking to do something similar!

[–] TechieDamien@lemmy.ml 1 points 1 year ago (1 children)

Wow, CUPS is way better than I previously thought and I thought it was amazing!

[–] GravelPieceOfSword@lemmy.ca 1 points 1 year ago

It is certainly useful for some use cases such as network print servers (I have a dedicated lxc container on the network to do this) and custom conversions of pages (during my digging, I learned about companies using a CUPS network printer to watermark every document being printed).

I'm not an expert by any means: it is definitely a useful tool in certain cases, but oh man.. the documentation was a bit hard to figure out for me!