Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2020 10:25:21 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Victor Sudakov <vas@sibptus.ru>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Brother HL-L2340D printer and lpd?
Message-ID:  <20200506102521.a6c47f8f.freebsd@edvax.de>
In-Reply-To: <20200506022131.GB56526@admin.sibptus.ru>
References:  <20200503171259.GA48627@admin.sibptus.ru> <20200505161952.GA34844@admin.sibptus.ru> <20200505185510.00b622e3.freebsd@edvax.de> <20200505180101.GA35751@admin.sibptus.ru> <20200505202331.53374f21.freebsd@edvax.de> <20200506022131.GB56526@admin.sibptus.ru>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Wed, 6 May 2020 09:21:31 +0700, Victor Sudakov wrote:
> Polytropon wrote:
> 
> [dd]
> 
> > > > > Now two questions are left:
> > > > > 
> > > > > 1. How the heck do I print text files with this setup? Should I convert
> > > > > them to PostScript first, and how? UTF-8 Cyrillic support is crucial.
> > > > 
> > > > Yes, gs expects PS as its input. For programs that print
> > > > (except here: Firefox), PS is the default output anyway.
> > > > But if you have ASCII text, you need to turn it into PS.
> > > > 
> > > > The easiest way to do this is the port "a2ps" (ASCII to
> > > 
> > > a2ps from packages is broken:
> > > 
> > > $ a2ps /etc/rc.conf
> > > a2ps: unknown medium `libpaper'
> > 
> > Install "libpaper" package and manually set a symlink in
> > /usr/local/etc: papersize -> papersize.a4 for standard ISO A4
> > paper, or papersize -> papersize.letter for US letter.
> 
> The package is installed and the files are present:
> 
> $ pkg info -o libpaper
> libpaper-1.1.24.4              print/libpaper
> $ file /usr/local/etc/papersize.*
> /usr/local/etc/papersize.a4:     ASCII text
> /usr/local/etc/papersize.letter: ASCII text
> 
> This does not work.

I just verified it is working. Just set the symlink accordingly.

% cd /usr/local/etc/
% ll papersize*
lrwxr-xr-x  1 root  wheel  12 2020-05-05 20:19:55 papersize@ -> papersize.a4
-rw-r--r--  1 root  wheel   3 2019-05-16 03:07:27 papersize.a4
-rw-r--r--  1 root  wheel   7 2019-05-16 03:07:27 papersize.letter

Seems that I already had libpaper installed, but the symlink to
make it work was missing. Yes, I used truss to discover it. ;-)



> > > > Personally, I use "encript" for turning ASCII reports
> > > 
> > > enscript is good, but it has huge problems with Cyrillic, and is totally
> > > lacking multibyte support (UTF-8).
> > 
> > Correct. That's why I had to use it with ISO-8859-1 standard
> > western europe character set (single byte per symbol) in order
> > to get Umlauts displayed correctly. Maybe another processing
> > step ("recode utf-8..koi8 <file>") can be used in the printer
> > filter.
> 
> Too much info (too many glyphs) are lost this way. I'm already used to
> non-koi8-compatible characters in my texts, even when they are plain
> texts.

That might be a problem due to this kind of tools not having
entered the era of multibyte encoding... :-)



> > > Oh! I wish I knew how to add something to Firefox's print dialog! 
> > > Do you?
> > 
> > If you define several printers in /etc/printcap (and not
> > forget to run cap_mkdb), a system running lpr should have
> > the available printers listed in Firefox's print dialog.
> > Unless, of course, Firefox is hard-wired with CUPS, and
> > no CUPS - no printer selection.
> 
> Looks like it's hardwired with GTK, and GTK is hardwired with
> something else, and nobody knows any more how it all works.

Yes, that is problematic. On the system I use CUPS, and I get
the printer selection as intended. But installing CUPS for the
purpose of not intentionally using it doesn't seem right.



> > Another idea might be to use the variable $PRINTER to name
> > the printer before starting Firefox. 
> 
> 
> Does not help either. 

It should. If Firefox just writes to lpr, lpr should use $PRINTER
(as per "man lpr"); depending on your shell, try to set the variable
in the shell's configuration file, re-login, and it should work.



> I've also tried tinkering with print.printer_list in about:config to no
> avail.

That's not a surprise to me: many things that are supposed to work
or have been working in the past have now been greatly disimproved
due to Linuxisms and YAGNI. ;-)





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20200506102521.a6c47f8f.freebsd>