Printing with CUPS & GNOME & LibreOffice under Fedora 20

Previously: LibreOffice printing Does.Not.Work. Not with GNOME, not with manual config, not at all. And maybe never has.; 2014-12-02
Frustration: very high


Success Recipe

GNOME

  • GNOME applications have their own print dialog; it works with CUPS.
  • GNOME print dilog can listen to IPP broadcasts
  • GNOME applications “just work.”

Verdict: GNOME printing “just works.”  Full Stop.

LibreOffice

  • LibreOffice applications have their own print dialog that might not work with CUPS.
  • LibreOffice print dialog cannot listen to IPP broadcasts
  • LibreOffice printing must be configured on a per-machine basis with spadmin
    • This can be done on a site-wide basis by superuser
    • This can be done on a per-user basis by the consumer.
  • Absent appropriate configuration, “Generic Printer” is the LibreOffice method
    This seems to just call lpr (/usr/bin/lpr) without any further arguments
    Of course, if printing is not manually configured (see above), this will fail silently.

Verdict: LibreOffice does not “just work”; you have to know a lot to get it configured correctly.

Details

  • /usr/lib64/libreoffice/program/spadmin
  • Configuration Files
    • /usr/lib64/libreoffice/share/psprint/psprint.conf
    • ~/.config/libreoffice/4/user/psprint/psprint.conf

Context

  • Two proud & storied developer groups: GNOME & LibreOffice.
  • Both implement a print dialog for their applications & suitable for their culture.
  • Neither dialog system works with the other.
  • Neither is willing to work with the other and change anything.
  • The consumer is left with: “does not work.”

Invariants

  • Internet Printing Protocol (IPP)
    • port 631
    • tcp/631 for client out connecting to cupsd (server)
    • udp/631 for server broadcasting availability of printers on the subnet
  • FirewallD of Fedora
    • May or may not allow anything but ssh (port 22) by default; tThis has varied across the releases.
    • Default in Fedora 20+ is to run firewalld with aggressive blocking (it’s a nasty world out there).

Ancillary

  • firewall-config
    sudo firewall-config
  • system-config-printer
    sudo system-config-printer
  • /usr/lib64/libreoffice/program/spadmin
    sudo /usr/lib64/libreoffice/program/spadmin

Evidence

$ cat /etc/fedora-release
Fedora release 20 (Heisenbug)
$ rpm -q -f /usr/bin/libreoffice
libreoffice-core-4.2.8.2-7.fc20.x86_64
$ rpm -q cups
cups-1.7.5-13.fc20.x86_64
$ rpm -q -a | grep system-config-print
system-config-printer-udev-1.4.7-1.fc20.x86_64
system-config-printer-1.4.7-1.fc20.x86_64
system-config-printer-libs-1.4.7-1.fc20.noarch
$ rpm -q -a | grep firewall-config
firewall-config-0.3.13-1.fc20.noarch

To ensure that the local print server is broadcasting…

$ sudo tcpdump -i em1 'port 631'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 65535 bytes
12:15:56.433174 IP loolie.sanguine.local.ipp > broadcast.sanguine.local.ipp: UDP, length 257
12:15:56.433199 IP loolie.freerange.local.ipp > broadcast.wireline.freerange.local.ipp: UDP, length 256
12:15:56.433203 IP loolie.wireline.foreign.local.ipp > broadcast.wireline.foreign.local.ipp: UDP, length 256
12:15:56.436333 IP joubijou.sanguine.local.ipp > broadcast.sanguine.local.ipp: UDP, length 260
12:15:56.436341 IP joubijou.freerange.local.ipp > broadcast.wireline.freerange.local.ipp: UDP, length 259
12:15:56.436388 IP joubijou.wireline.foreign.local.ipp > broadcast.wireline.foreign.local.ipp: UDP, length 259

firewalld

Configure the host’s firewall to allow IPP announcements to be received.

GNOME

  • GNOME print dialog “just works” with GNOME apps & CUPS.
    Exhibit with gedit.

LibreOffice

  • Host requires configuration via system-config-printer
  • Host requires configuration via spadmin
system-config-printer

Establish a manually-defined printer which pulls from the IPP-available printer on the print server.  You have to do this because LibreOffice’s print dialog cannot understand the IPP broadcast messages that are flying about.  LibreOffice can only shoot at an existing IPP printer (via cupsd) that you have defined manually.

spadmin of LibreOffice

Now you have to manually configure LibreOffice to use the manually-configured printer that you just manually configured.  This is a manual step that you must manually repeat for each host and consumer that you manage.  Manually.

 

LibreOffice printing Does.Not.Work. Not with GNOME, not with manual config, not at all. And maybe never has.

Seems that …

  • LibreOffice printing is broken; more specifically, the print selection dialog.
  • Maybe it always has been broken, but who prints nowadays?

But

  • This seems like one of those classic cases in open source where Group A with Application A thinks their Widget is better than Group B which writes all the other applications and defines the whole culture in which both live and whose Widget works, just works, and is in use by everyone.
  • So Group A continues to refuse to integrate their application.  Their pride is enbiggened.  Users don’t get any Widget services from Application A.

Workaround

  • Export as PDF
  • Print the PDF
    • lpr from the command line
    • evince for the cli-challenged

Environment

  • Fedora 19-21
  • GNOME
  • CUPS printing functions
    • announced network-wide
    • via ipp on IPv4 and IPv6
  • Works everywhere but LibreOffice.
    • in all GNOME applications
    • in Firefox 29

Folklore

  • Something about how spadmin should be used to configure the LibreOffice printers
    • /usr/lib64/libreoffice/program/spadmin
    • Response:
      • Doesn’t do anything
      • The Use System Print Dialog setting
        • charitably, doesn’t work at all
        • it seems to truncate printing functionality, it flashes a dialog that never draws … but nothing prints.
  • Printing problems with libreoffice and (remote) cups server; In SuperUser; 2014-01
    • Diagnosis: Only the Generic Printer shows up, not the network-wide CUPS printers
    • Remediation
      • Tools->Settings->General
      • Uncheck: Use LibreOffice Dialogs
      • Check: Use Experimental Features
    • Response: The dialogs indicated don’t match what’s in the product (any longer).
  • CUPS printing problem with LibreOffice; In Arch Linux Forums; 2013-11-26.
    • Claim: used to work until cups-1.7.0
    • Response: resolution unclear, the thread trails off…
  • Alan Bell; UDS Desktop Improve Print Dialogs; some random notes; circa 2012-12-01?
    • Hints about gtk2 and gtk3 print dialogs
    • Reminder that LibreOffice does their own thing, their print dialog won’t work.
    • Printing, Wireframes; GNOME
  • CUPS printers not available from KDE or LibreOffice; In Ask Fedora; 2012-08-27
    • 853929 Cups printers not available from kde or libreoffice
    • Claim: upgrade to cups 1.4.2 fixes the problem
    • Response: must have been a different problem; Fedora 19 uses CUPS 1.9.x
  • GNOME Print Dialog; In Ask LibreOffice; 2012-05-16.
    • Remediation Recipe
      • Tools->Settings->General
      • Uncheck: Use LibreOffice Dialogs
      • Check: Use Experimental Features
    • Response: the v4.1 product no longer works like this.

Files

$ find /usr/lib64/libreoffice .config/libreoffice -name 'ps*conf'
  • /usr/lib64/libreoffice/share/psprint/psprint.conf
  • ~/.config/libreoffice/4/user/psprint/psprint.conf
[__Global_Printer_Defaults__]
DisableCUPS=false

The LibreOffice 4 spadmin Interface


The LibreOffice 4 Print Dialog


The GNOME Print Dialog

Follows CUPS broadcasts … there are your printers … right there!