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

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Polytropon wrote:
> > >=20
> > > I'm trying to use a Brother HL-L2340D printer as a simple networked
> > > line printer with lpd. I've successfully used HP and Canon printers l=
ike
> > > that with a simple printcap like this:
> >=20
> > The story continues with some good news.
> >=20
> > Thanks to much insight and help from Polytropon (off list also), and
> > this page:
> > https://support.brother.com/g/b/faqend.aspx?c=3Dus&lang=3Den&prod=3Dhll=
2340dw_us_eu_as&faqid=3Dfaq00100602_000
> >=20
> > I've been able to print PDF files (lpr -P ps mozilla.pdf)=20
> > on this printer with the following printcap entry:
> >=20
> > ps|Brother HL-L2340D series PostScript:\
> >         :sh:\
> >         :lp=3D9100@192.168.1.74:\
> >         :if=3D/usr/local/etc/ps2pcl.sh:\
> >         :sd=3D/var/spool/output/lpd2:lf=3D/var/log/lpd-errs:
> >=20
> > while the ps2pcl.sh looks like this (thanks again to Polytropon):
> >=20
> > #!/bin/sh
> >=20
> > #/usr/bin/printf "\033&k2G" || exit 2
> > /usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \
> >         -sDEVICE=3Dhl1250 -sPAPERSIZE=3Da4 -r600x600 \
> >         -sOutputFile=3D- - && exit 0
> > exit 2
> >=20
> > So GhostScript's "hl1250" driver works wonders, I even see Cyrillic
> > text in the printed PDF.
>=20
> Basically, gs will "raster" any PS input it gets. So whatever
> symbols are there, they will work without any further tools,
> be it chinese symbols or images or german Umlauts. :-)

A PostScript translator (GhostScript or any other) can be expected to
"raster" the PS input incorrectly if this input contains encodings it does
not understand, or glyphs/fonts it is lacking.

I've seen so many problems with Cyrillic in my life, believe me. I've
seen PDFs with some Cyrillic glyphs replaced by garbage, and much more
of such weird stuff than I wish to see.

>=20
> Thanks for posting the _solution_ to your problem. Future
> readers will now know that gs's filter "hl1250" works with
> this particular printer.

This is not a final solution. I'm currently hacking the Linux LPR
"driver" for this printer (hll2340dlpr-3.2.0-1.i386.deb), and maybe
(just maybe) I'll be able to figure out what Linux sends to it to enable
ascii LPR printing.

In this package, there is a promising small linux binary which Linux
uses as an if=3D. I guess it has magic within.

>=20
>=20
> > Now two questions are left:
> >=20
> > 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.
>=20
> 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.
>=20
> 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'

>=20
> 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).

>=20
> > 2. How do I convince Mozilla Firefox that I now have a PostScript
> > printer and it can print directly to it, not just to a PDF file? It does
> > not seem to care for /etc/printcap.
>=20
> Correct. Firefox doesn't care what you want. ;-)
>=20
> The default "print to file" of Firefox now uses PDF, as
> many modern printers accept PDF directly. But you can use
> the tool "pdftops" installed by the port "xpdf".

No, it's not necessary, GhostScript eats PDFs just fine.

>=20
> Sidenote: You can even put this into an additional printer
> filter in /etc/printcap, for example with the printer name
> "pdf",=20


> and address that printer from Firefox's print dialog,

Oh! I wish I knew how to add something to Firefox's print dialog!=20
Do you?

--=20
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

--zhXaljGHf11kAtnf
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJesandAAoJEA2k8lmbXsY0zuEIAI0KY6XTzQiUgqAFVwbBnCKw
vAFWt8BtF05jsfbwtdZTUbxw+yGHN6r76Y/qONcWJ7rfV7UjF190zJm9rbq9O+m3
ObjtpXIGCFz191snZE4ua8kXd46268r3WQvMtNb8sR6nM4oi6J41IjrCf4chBEXg
2oA6PKBxP4FkNbnkrcxu9Q7z2FqpUsuE8g5taCLh9BQxS63/FU8a5ubc4U8XYpki
JDse+Ik3OkyR6hZii0Zablsb67b9Rwq94eAQ3mBZi3DR7lCsXY+4Argm5/gvsfZf
WURLXfZEIFymyAKa2LxHrdEXWCxlGYStEIk/KcmF5nVWFulz3Qx+BnC6zUTEV7E=
=rHbg
-----END PGP SIGNATURE-----

--zhXaljGHf11kAtnf--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20200505180101.GA35751>