lp and emacs do not print from Lexmark MS312dn

Using Opensuse Leap 15.1 and the Lexmark MS312dn, I cannot print texts with the lp command, and I cannot print buffers from emacs 25.3.

In the summer of 2018, I still was working with an old HP Laserjet 1020. But I often had problems with the HP. I wanted to buy a postscipt printer for various reasons. According to Openprinting, the Lexmark MS312dn works “perfectly” under Linux. This statement was a reason to buy the printer in 2018. Another reason was the supposedly easy installation under Linux. Allegedly a PPD file in the right place is sufficient. Later I was wondering why then there are rpm and deb packages on the Openprinting Lexmark site?

Coming back to my issue. After I had installed the PPD file, the Lexmark printer has been working really well when it comes to printing graphics, pictures, pdf-files, libreoffice documents or text documents. It is also printing Korean letters, something which I would like to do in emacs as well, but failed to to do until now.

But, as I have stated in the beginning, I cannot print texts with the lp command, and I cannot print buffers from emacs 25.3.

Perhaps I did a mistake when installing the printer? First I visited the Openprinting page. It offers two different PPD-files: one is written by Lexmark International in 2012 (FormatVersion: “4.3”, FileVersion: “1.0”) and the other is the Openprinting PPD file (FormatVersion: “4.3”, FileVersion: “1.1”) . First I downloaded and copied the Lexmark file:


$ cp ~/Downloads/Lexmark-MS312dn-Postscript-Lexmark.ppd.tar /usr/share/cups/model

I do not know the exact names of the English menus, but I try to reproduce them accurately. I turned the printer on and connected it via USB with my notebook. Then I opened the printer configuration in the Yast printer module and went to “add”. The system was looking for a new printer, and it showed me that it has found the Lexmark Printer. In the “Find and Assign a Driver section”, I clicked on Driver Packages and entered the full path to the PPD file into the text box under “Make a Printer Description File Available”, confirmed it with OK and returned to the printer configuration menu.

Since I could not print with lp after that procedure, I followed the steps above again with the Openprinting PPD file. In the driver section in the Yast printer module, I chose “Open Printing PPDs”. Now I have various PPD files in the folder /usr/share/cups/model/OpenPrintingPPDs/postscript which can be considered. But that did not help either.

The printer is available under localhost:631/printers/, but I did not install it separately with the cups interface.

Then I switched back to the first PPD by Lexmark.

Currently it seems that cups uses “/etc/cups/ppd/lexmarkms312.ppd”:


linux-aj5o:~ # lpstat -l -t

Zeitplandienst läuft
systemvoreingestelltes Ziel: lexmarkms312
Gerät für lexmarkms312: usb://Lexmark/MS310%20Series?serial=45147PLM4H7VH
lexmarkms312 akzeptiert anfragen seit Sa 15 Feb 2020 22:13:45 KST
Drucker lexmarkms312 ist im Leerlauf.  Aktiviert seit Sa 15 Feb 2020 22:13:45 KST
        Geladenes Formblatt
        Inhaltstypen: beliebig
        Druckertypen: unbekannt
        Beschreibung: Lexmark MS310 with driver Lexmark MS310 Series
        Alarme: none
        Ort: /usr/share/cups/model/OpenPrintingPPDs/postscript/Lexmark-MS312dn.Postscript-Lexmark.ppd.gz
        Verbindung: direkt
        Schnittstelle: /etc/cups/ppp/lexmarkms312.ppd
        Bei Fehlern: kein Alarm
        Nach einem Fehler: fortfahren
        Erlaubte Benutzer:
                (alle)
        Erlaubte Formblätter:
                (keine)
        Banner erforderlich
        Zeichensatz Set:
                (keine)
        Voreingestellte Neigung:
        Voreingestellte Seitengrösse:
        Voreingestellte Porteinstellungen:
        Voreingestellte Porteinstellungen:

But there is no /etc/cups/ppp/lexmarkms312.ppd file. I can only find two files in /etc/cups/ppd:


# ls -l /etc/cups/ppd
insgesamt 256
-rw-r----- 1 root lp 128630 15. Feb 22:06 lexmarkms312.ppd
-rw-r----- 1 root lp 128638 15. Feb 16:07 lexmarkms312.ppd.O

A quite informative thread in this forum last year described some printing issues with the Lexmark MS312dn when using Opensuse 15.1. I considered to post my question there. The problem described in this thread, however, is a bit different from my issue.

When I print a buffer (“Print Buffer”) in emacs or when I use the lp command for instance


lp ~/.emacs

… the printer prints something like this on paper


ERROR: ioerror
OFFENDING COMMAND: StartData

STACK:
0
(
...
)

arraytype
60.0

The points … are some characters that I do not reproduce here.

When I am printing from emacs via “Postscript Print Buffer”, I get on paper


ERROR: invalidfont
OFFENDING COMMAND

STACK
# ERROR: invalidfont
# OFFENDING COMMAND: stringwidth

# STACK:

( )
/SpaceWidth
60.0

# ERRORINFO:

I tried it with various fonts and also with courier, which is supported by the printer.

On the basis of the commands in the thread from 2019 previously mentioned I give some additional information:


rpm -qa | sort | egrep -i 'cups|foom|ppd|guten'

cups-2.2.7-lp151.6.3.1.x86_64
cups-client-2.2.7-lp151.6.3.1.x86_64
cups-config-2.2.7-lp151.6.3.1.x86_64
cups-filters-1.20.3-lp151.3.6.1.x86_64
gutenprint-5.2.14-lp151.2.3.x86_64
libcups2-2.2.7-lp151.6.3.1.x86_64
libcups2-32bit-2.2.7-lp151.6.3.1.x86_64
libcupscgi1-2.2.7-lp151.6.3.1.x86_64
libcupsimage2-2.2.7-lp151.6.3.1.x86_64
libcupsmime1-2.2.7-lp151.6.3.1.x86_64
libcupsppdc1-2.2.7-lp151.6.3.1.x86_64
libzypp-plugin-appdata-1.0.1+git.20180426-lp151.3.1.noarch
OpenPrintingPPDs-postscript-4.0.0.2-lp151.2.1.noarch
python2-appdirs-1.4.3-lp151.2.1.noarch
python3-appdirs-1.4.3-lp151.2.1.noarch
python3-cupshelpers-1.5.7-lp151.6.3.noarch
python3-pycups-1.9.73-lp151.2.4.x86_64


rpm -qf /usr/lib/cups/filter/

cups-2.2.7-lp151.6.3.1.x86_64
cups-filters-1.20.3-lp151.3.6.1.x86_64


ls -l /usr/lib/cups/filter/

insgesamt 1256
-rwxr-xr-x 1 root root  56472 29. Nov 18:20 bannertopdf
-rwxr-xr-x 1 root root   2367 29. Nov 18:20 brftoembosser
-rwxr-xr-x 1 root root   3309 29. Nov 18:20 brftopagedbrf
lrwxrwxrwx 1 root root     11 29. Nov 18:20 cgmtopdf -> vectortopdf
lrwxrwxrwx 1 root root     11 29. Nov 18:20 cmxtopdf -> vectortopdf
-rwxr-xr-x 1 root root  10520 29. Nov 18:20 commandtoescpx
-rwxr-xr-x 1 root root  10496 29. Nov 18:20 commandtopclx
-rwxr-xr-x 1 root root  14392 22. Nov 04:11 commandtops
lrwxrwxrwx 1 root root     11 29. Nov 18:20 emftopdf -> vectortopdf
-rwxr-xr-x 1 root root 110560 29. Nov 18:20 foomatic-rip
-rwxr-xr-x 1 root root    555 29. Nov 18:20 gstopdf
-rwxr-xr-x 1 root root    558 29. Nov 18:20 gstopxl
-rwxr-xr-x 1 root root  23128 29. Nov 18:20 gstoraster
-rwxr-xr-x 1 root root  10296 22. Nov 04:11 gziptoany
-rwxr-xr-x 1 root root   3733 29. Nov 18:20 imagetobrf
-rwxr-xr-x 1 root root  39616 29. Nov 18:20 imagetopdf
-rwxr-xr-x 1 root root    988 29. Nov 18:20 imagetops
-rwxr-xr-x 1 root root  53240 29. Nov 18:20 imagetoraster
lrwxrwxrwx 1 root root     10 29. Nov 18:20 imagetoubrl -> imagetobrf
-rwxr-xr-x 1 root root   6652 29. Nov 18:20 imageubrltoindexv3
-rwxr-xr-x 1 root root   6720 29. Nov 18:20 imageubrltoindexv4
-rwxr-xr-x 1 root root   1842 29. Nov 18:20 musicxmltobrf
-rwxr-xr-x 1 root root  23272 29. Nov 18:20 pdftoijs
-rwxr-xr-x 1 root root 151512 29. Nov 18:20 pdftoopvp
-rwxr-xr-x 1 root root 155336 29. Nov 18:20 pdftopdf
-rwxr-xr-x 1 root root  39928 29. Nov 18:20 pdftops
-rwxr-xr-x 1 root root  35784 29. Nov 18:20 pdftoraster
-rwxr-xr-x 1 root root  51280 22. Nov 04:11 pstops
lrwxrwxrwx 1 root root     13 22. Nov 04:11 rastertodymo -> rastertolabel
-rwxr-xr-x 1 root root  18488 22. Nov 04:11 rastertoepson
-rwxr-xr-x 1 root root  31312 29. Nov 18:20 rastertoescpx
-rwxr-xr-x 1 root root  18488 22. Nov 04:11 rastertohp
-rwxr-xr-x 1 root root  22584 22. Nov 04:11 rastertolabel
-rwxr-xr-x 1 root root    563 29. Nov 18:20 rastertopclm
-rwxr-xr-x 1 root root  35448 29. Nov 18:20 rastertopclx
-rwxr-xr-x 1 root root  85304 29. Nov 18:20 rastertopdf
-rwxr-xr-x 1 root root  14688 29. Nov 18:20 rastertops
-rwxr-xr-x 1 root root  14392 22. Nov 04:11 rastertopwg
lrwxrwxrwx 1 root root     11 29. Nov 18:20 svgtopdf -> vectortopdf
-rwxr-xr-x 1 root root  27352 29. Nov 18:20 sys5ippprinter
-rwxr-xr-x 1 root root   3671 29. Nov 18:20 textbrftoindexv3
lrwxrwxrwx 1 root root     16 29. Nov 18:20 textbrftoindexv4 -> textbrftoindexv3
-rwxr-xr-x 1 root root   6092 29. Nov 18:20 texttobrf
-rwxr-xr-x 1 root root  59376 29. Nov 18:20 texttopdf
-rwxr-xr-x 1 root root    982 29. Nov 18:20 texttops
-rwxr-xr-x 1 root root  23000 29. Nov 18:20 texttotext
-rwxr-xr-x 1 root root   2557 29. Nov 18:20 vectortobrf
-rwxr-xr-x 1 root root   2177 29. Nov 18:20 vectortopdf
lrwxrwxrwx 1 root root     11 29. Nov 18:20 vectortoubrl -> vectortobrf
lrwxrwxrwx 1 root root     11 29. Nov 18:20 wmftopdf -> vectortopdf
lrwxrwxrwx 1 root root     11 29. Nov 18:20 xfigtopdf -> vectortopdf

I would be glad if somebody could give me a hint.

Did you try the driver package from Lexmark? (I note nothing for 15.1 specifically, but with luck an older version will be ok)
http://support.lexmark.com/index?productCode=LEXMARK_MS312&page=driversdownloads&linkSelected=node4&locale=EN&userlocale=EN_US

I suspect your options are limited here unfortunately.

Thank you for your suggestion. I remember that I tried it with an rpm package from Lexmark about a year ago. I will check the driver package and report back.

I downloaded a package from Lexmark: “PPD (PostScript Printer Description) files for 64-bit Linux distributions with RPM-based packaging”.

Filename: Lexmark-AEW-PPD-Files-1.0-06132018.x86_64.rpm
Date: 06/15/18

Then I deleted the printer in the Yast configuration menu and installed the package:


$ rpm -i Lex*

Copyright 2018 Lexmark International, Inc. All rights reserved.

Installing Lexmark Print Driver...
Model Detail: Lexmark-AEW-PPD-Files
x86_64 / x86_64
CUPS Version: PPD_1_4
cat: /usr/local/Lexmark/ppd/Lexmark-AEW-PPD-Files/License.txt: Datei oder Verzeichnis nicht gefunden
Restarting CUPS...
Restarting CUPS... Done!
Restarting CUPS... Done!

Installation complete... :)

The installation seems to have completed successfully, although the licence file was not found (“Datei oder Verzeichnis nicht gefunden”).
I logged out, then I logged in again and installed the printer in the cups interface.

Printing from libreoffice seems to work fine, but printing with lp and printing from emacs still has the same unsatisfactory result.