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!

  • GravelPieceOfSword@lemmy.caOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    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!

      • GravelPieceOfSword@lemmy.caOP
        link
        fedilink
        arrow-up
        1
        ·
        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!