Solved Printing With Lexmark Optra E312

I set up my printer using:

http://localhost:631/

and by installing:

print/gutenprint-cups

There was no driver specifically for that model of printer and it doesn't appear that Lexmark has one for FreeBSD. I used a generic driver and made a number of trial runs until I found one that allowed me to print a PDF file. So far, so good.

Does anyone know if there is an Optra E312 driver specifically for FreeBSD or would any of the *nix drivers on Lexmark's website work?

Thank you.
 
The Openprinting site linked above makes an important distinction between the Optra E312 and the Optra E312L. The E312 is Postscript and PCL6 capable while the E312L does not support postscript. I would assume the "L" is just PCL6 capable.

The PCL6 based ppd actually use the ghostscript plxmono driver or the gutenprint enhancement and you can generate your own ppd based on that driver. A couple of edits to the ppd allow you to set the default paper size, ie a4 vs letter, default resolution, etc. I compared the Gutenprint based driver vs ljet4 and the gutenprint driver took longer and produced darker shading. I thought the ghostscript based driver looked "cleaner"

But if the Optra E312 is truely postscript capable you should not need a driver at all - it is already built into the printer.

Does anyone know if there is an Optra E312 driver specifically for FreeBSD or would any of the *nix drivers on Lexmark's website work?

Since you are specifically asking for a "FreeBSD" driver you need to be aware that there is a FreeBSD lpr print spooler that the handbook addresses and would not need a "driver" for a postscript capable printer. FreeBSD also provides print/cups and for this you would need the right ppd. The openprinting site provides an adobe licensed ppd for the E312. I checked and the download is valid and specific for the E312.
 
The Openprinting site linked above makes an important distinction between the Optra E312 and the Optra E312L. The E312 is Postscript and PCL6 capable while the E312L does not support postscript. I would assume the "L" is just PCL6 capable.

The PCL6 based ppd actually use the ghostscript plxmono driver or the gutenprint enhancement and you can generate your own ppd based on that driver. A couple of edits to the ppd allow you to set the default paper size, ie a4 vs letter, default resolution, etc. I compared the Gutenprint based driver vs ljet4 and the gutenprint driver took longer and produced darker shading. I thought the ghostscript based driver looked "cleaner"

But if the Optra E312 is truely postscript capable you should not need a driver at all - it is already built into the printer.



Since you are specifically asking for a "FreeBSD" driver you need to be aware that there is a FreeBSD lpr print spooler that the handbook addresses and would not need a "driver" for a postscript capable printer. FreeBSD also provides print/cups and for this you would need the right ppd. The openprinting site provides an adobe licensed ppd for the E312. I checked and the download is valid and specific for the E312.
I've been tinkering with it after I installed that driver. I tried printing part of a PDF document and, for some reason, I get the message:

Code:
"/usr/local/libexec/cups/filter/foomatic-rip" not available:  No such file or directory

I was, however, able to print that same document with a generic PCL5 driver.

For some reason, though, the generic PCL6 driver didn't quite work when I was logged in on my own account. The first page would come out as rubbish while the rest were unaffected. I'm not sure what happened as I didn't have any problems when I was logged in as root.
 
I am assuming you are using the lpr system rather than cups:).

Chapter 9 in the handbook was recently re-written by one of the moderators, wblock@, and should get you set up with basic printing functionality. Links to implement advanced features are below.

To implement advanced features, you have two options: passing postscript commands directly or calling them through foomatic-rip This Thread 40651 shows how to use postscript commands directly in a filter.

foomatic-rip functions like a wrapper script to a ppd. In FreeBSD, foomatic-rip is available in print/foomatic-filters or print/hpijs. You have to choose foomatic-filters or hpijs, both will not install. In your case I would use foomatic-filters since your hardware is not H-P based.

This OpenBSD readme concisely describes foomatic-rip setup and an example to print #10 envelope landscape is here in post #7. You will see that foomatic-rip has to reference a specific ppd in the filter and in your case I would use the lexmark E312ppd.

Postscript version 2 will not print pdfs natively, 3 will. I think the E312 is Postscript 3 but if not, there are workarounds to convert pdf -> postscript.
 
Last edited:
I am assuming you are using the lpr system rather than cups:).
I installed CUPS, so maybe that's the source of the problem. Maybe I should try lpr instead.
Chapter 9 in the handbook was recently re-written by one of the moderators, wblock@, and should get you set up with basic printing functionality. Links to implement advanced features are below.

To implement advanced features, you have two options: passing postscript commands directly or calling them through foomatic-rip This Thread 40651 shows how to use postscript commands directly in a filter.

foomatic-rip functions like a wrapper script to a ppd. In FreeBSD, foomatic-rip is available in print/foomatic-filters or print/hpijs. You have to choose foomatic-filters or hpijs, both will not install. In your case I would use foomatic-filters since your hardware is not H-P based.

This OpenBSD readme concisely describes foomatic-rip setup and an example to print #10 envelope landscape is here in post #7. You will see that foomatic-rip has to reference a specific ppd in the filter and in your case I would use the lexmark E312ppd.

Postscript version 2 will not print pdfs natively, 3 will. I think the E312 is Postscript 3 but if not, there are workarounds to convert pdf -> postscript.
Thanks for the info.
 
It should also work with print/cups; which one is best depends on your needs.

Lpr printing is simple, elegant, good error codes, in my opinion is a better learning tool and is included in the base install. It is easy to trace your print job just from the entries in the printcap.

Once set up it is fairly portable between BSDs and Debian based systems. Debian provides lpr as a printing option; /etc/printcap and my filter essentially copy over. In linux and NetBSD I have to adjust for the ghostscript location (/usr/bin/gs or /usr/pkg/bin/gs respectively) and be sure I name the spool directories in the printcap consistently.

Redhat/Fedora pushes print/cups and all Fedora/RHEL 7.x gtk3 apps only print to a pdf file or cups. If your are in a mixed Redhat/FreeBSD environment, cups would be attractive.
 
It should also work with print/cups; which one is best depends on your needs.

Lpr printing is simple, elegant, good error codes, in my opinion is a better learning tool and is included in the base install. It is easy to trace your print job just from the entries in the printcap.

Once set up it is fairly portable between BSDs and Debian based systems. Debian provides lpr as a printing option; /etc/printcap and my filter essentially copy over. In linux and NetBSD I have to adjust for the ghostscript location (/usr/bin/gs or /usr/pkg/bin/gs respectively) and be sure I name the spool directories in the printcap consistently.

Redhat/Fedora pushes print/cups and all Fedora/RHEL 7.x gtk3 apps only print to a pdf file or cups. If your are in a mixed Redhat/FreeBSD environment, cups would be attractive.
I first started working with FreeBSD several years ago (version 6.x, I think) and I set up my system for printing. I think I used CUPS, or something like it, but it was flaky, which was one reason I put FreeBSD aside for a while.

I will give lpr a try, though.
 
I think I used CUPS, or something like it, but it was flaky, which was one reason I put FreeBSD aside for a while.
That is silly as CUPS works as good on any BSDs as on Linux or OS X. By the way Apple owns CUPS so I never understood attachment of GNU/Linux people to that particular spooling system.
 
I first set up lpr(1) but I had problems in printing a PDF file after following the directions in chapter 9 of the FreeBSD manual.

The page had a message that said that a PostScript Level 3 printer was required for that job and the Lexmark Optra E312 is, according to the manual, only Level 2. I removed both print/gutenprint-cups and print/cups, rebooted the machine, and got the same message.

I don't know of any way that the printer can handle Level 3, if it's even possible, so it may be that lpr(1) might be of limited use to me.

However, the setup I had before, using CUPS and the generic PCL5 driver, didn't appear to have any problems in printing from that PDF document. Maybe I should go back to that and leave well enough alone. I don't need anything really fancy for most of the printing that I do.
 
I don't know of any way that the printer can handle Level 3, if it's even possible, so it may be that lpr(1) might be of limited use to me.

There are several "work arounds" to print pdf's on PS level 2 printers. The quickest is to install graphics/xpdf and print from it. graphics/evince and graphics/okular will also open the pdf and send ps output when printing. print/gv opens both ps and pdf documents, can change orientation and/or papersize and print.

Another is to use a utility to convert pdf => to ps. print/ghostscript has $ pdf2ps.

If you are going to be printing alot of pdf's, you could set up a second printer queue using PCL5/PCL6. If you named the second printer "pdf", # lpr -P pdf mydocument.pdf should print it.

Lastly, you could set all your printing to use a filter as described in section 9.5.3.3. of the handbook. This would essentially use the same print filtering that your cups setup was using. I would use the pxlmono driver over ljet4 driver as it is capable of using your printer's 1200x1200dpi resolution. The ljet4 drivers is max'd out at 600x600dpi.
 
Last edited:
`
There are several "work arounds" to print pdf's on PS level 2 printers. The quickest is to install graphics/xpdf and print from it.
This seems to be the only one that works on my machine. I printed some pages from the PDF document I'm using for testing, but, for some reason, the text is shifted down a line or so.

I'll be looking through the man page for xpdf() and xpdfrc() to see if I can fix that.

I wasn't using any PostScript/PDF filters for this. Was I supposed to?

graphics/evince and graphics/okular will also open the pdf and send ps output when printing. print/gv opens both ps and pdf documents, can change orientation and/or papersize and print.

Another is to use a utility to convert pdf => to ps. print/ghostscript has $ pdf2ps.

If you are going to be printing alot of pdf's, you could set up a second printer queue using PCL5/PCL6. If you named the second printer "pdf", # lpr -P pdf mydocument.pdf should print it.

Lastly, you could set all your printing to use a filter as described in section 9.5.3.3. of the handbook. This would essentially use the same print filtering that your cups setup was using. I use the pxlmono driver over ljet4 driver as it can print at higher resolution 1200x1200dpi vs 600x600dpi.
 
I printed some pages from the PDF document I'm using for testing, but, for some reason, the text is shifted down a line or so.

One possibility it that your page sizes don't match, ie sending a letter size job to an a4 printer. I'm in the states using letter but the config files below can easily be edited to a4
Postscript output has the page size embedded and the ps output generated by xpdf and gv needs to match the paper, Margins are also configurable to a limit. My old HP 5L has minimal margins of 1/2 inch.
~/.xpdfrc
Code:
psPaperSize letter
enableFreeType yes
antialias yes
psFile "| lpr"
urlCommand "firefox-esr %s"

~/.gv
Code:
GV.version: gv 3.6.7.90
GV.fallbackPageMedia:   Letter

GV.infoVerbose: Errors
GV.scale: 0
GV.scaleBase: 1
GV.fallbackOrientation: Seascape
GV.orientation: Portrait
GV.pageMedia: Automatic
GV.swapLandscape:       True
GV.autoResize: False
GV.antialias: True
GV.watchFile: False
GV.ignoreEOF: True
GV.respectDSC: True

In regards to filters, there are many options. You can peruse some of them in this Thread 50281.
 
One possibility it that your page sizes don't match, ie sending a letter size job to an a4 printer. I'm in the states using letter but the config files below can easily be edited to a4
Postscript output has the page size embedded and the ps output generated by xpdf and gv needs to match the paper, Margins are also configurable to a limit. My old HP 5L has minimal margins of 1/2 inch.
~/.xpdfrc
Code:
psPaperSize letter
enableFreeType yes
antialias yes
psFile "| lpr"
urlCommand "firefox-esr %s"
I created a file and added this information plus:

Code:
psCenter yes
psLevel level2
It didn't seem to have any effect. The top margin remains about 2.5 cm lower than it should be, even though the document is in legal format. The side margins appear to be OK.

I suspect there's a printer setting that's not correct. I checked this when I saved a simple text file as a PDF and printed that. The results were the same as before.
~/.gv
Code:
GV.version: gv 3.6.7.90
GV.fallbackPageMedia:   Letter

GV.infoVerbose: Errors
GV.scale: 0
GV.scaleBase: 1
GV.fallbackOrientation: Seascape
GV.orientation: Portrait
GV.pageMedia: Automatic
GV.swapLandscape:       True
GV.autoResize: False
GV.antialias: True
GV.watchFile: False
GV.ignoreEOF: True
GV.respectDSC: True

In regards to filters, there are many options. You can peruse some of them in this Thread 50281.
For some reason,when I installed and tried Gv, it didn't see my printer.
 
Per the print/gv Makefile, the default gv configuration options are suppose to be in
Code:
PLIST_FILES= bin/gv \
29 bin/gv-update-userconfig \
30 %%DATADIR%%/gv_system.ad \
31 lib/X11/app-defaults/GV \

and on my OpenBSD system
Code:
PooBear# less GV | grep print
!                       print_all       \n\
!                       print_marked    \n\
!GV.printCommand:       lpr

I would add

Code:
GV.printCommand:       lpr
to your local
~/.gv configuration file.

When using gv, the print options should display the default, and also allow you to change the print command.

The other thing that is confusing is papersize defaults. Some FreeBSD applications, print/a2ps and print/enscript have the default papersize specified at installation, ie there are enscript-a4 and enscript-letter versions. In OpenBSD, a2ps and encript reference the system wide /etc/papersize setting. FreeBSD also has a system wide /usr/local/etc/papersize and I am unclear which setting prevails in FreeBSD. I addressed the confusion by setting every papersize setting I found to letter.
 
Per the print/gv Makefile, the default gv configuration options are suppose to be in
Code:
PLIST_FILES= bin/gv \
29 bin/gv-update-userconfig \
30 %%DATADIR%%/gv_system.ad \
31 lib/X11/app-defaults/GV \

and on my OpenBSD system
Code:
PooBear# less GV | grep print
!                       print_all       \n\
!                       print_marked    \n\
!GV.printCommand:       lpr

I would add

Code:
GV.printCommand:       lpr
to your local
~/.gv configuration file.

When using gv, the print options should display the default, and also allow you to change the print command.

The other thing that is confusing is papersize defaults. Some FreeBSD applications, print/a2ps and print/enscript have the default papersize specified at installation, ie there are enscript-a4 and enscript-letter versions. In OpenBSD, encript references the system wide /etc/papersize setting. FreeBSD also has a system wide /usr/local/etc/papersize and I am unclear which setting prevails in FreeBSD.

I gave gv another try. I'm not sure what happened, but it worked. The pages come out properly aligned both when I'm running as root and in my own account.

So far so good. I'll play with it a bit more but this might do the job for me.

Thank you.
 
Back
Top