From owner-freebsd-questions@freebsd.org Wed May 6 14:55:42 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5149F2C6D1D for ; Wed, 6 May 2020 14:55:42 +0000 (UTC) (envelope-from vas@sibptus.ru) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49HKQj5Hzvz3FhT for ; Wed, 6 May 2020 14:55:41 +0000 (UTC) (envelope-from vas@sibptus.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=UDS5q2l7DzMh4VcAWOUtqhdiR7UjNWSsuyWjgEPpoKo=; b=Vc6Ju0+3z6SJAVWXw22IVARV+/ Ag6nckZ9h/Ji+S+f7SA4LopRzzJpq0wz2bMy1OwSrm2rawqqAcfBUccV/Kh6Xcu85Vzg+hA+xRh2K FEpzwexBnxl2MNIEkDInt/ClbmKYMWvIb48SQVQbtvFwrKLg/vRcVYR/AX8t/33BaPx0=; Received: from vas by admin.sibptus.ru with local (Exim 4.93.0.4 (FreeBSD)) (envelope-from ) id 1jWLSV-000M0m-DU; Wed, 06 May 2020 21:55:39 +0700 Date: Wed, 6 May 2020 21:55:39 +0700 From: Victor Sudakov To: Steve O'Hara-Smith Cc: Polytropon , freebsd-questions@freebsd.org Subject: Re: Brother HL-L2340D printer and lpd? Message-ID: <20200506145539.GC83950@admin.sibptus.ru> References: <20200505185510.00b622e3.freebsd@edvax.de> <20200505180101.GA35751@admin.sibptus.ru> <20200505202242.c16f07feef5674fc7b6e6fe9@sohara.org> <20200506015935.GA56526@admin.sibptus.ru> <20200506071659.8730d1d68f9d47e4407790f3@sohara.org> <20200506102943.6f68ea4859f8de9661e25895@sohara.org> <20200506103620.f23dcb43f26697795686ee18@sohara.org> <20200506103026.GA74014@admin.sibptus.ru> <20200506120655.20c05800cda62c3887c0f4f9@sohara.org> <20200506113009.GD77496@admin.sibptus.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: <20200506113009.GD77496@admin.sibptus.ru> X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 X-Rspamd-Queue-Id: 49HKQj5Hzvz3FhT X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sibptus.ru header.s=20181118 header.b=Vc6Ju0+3; dmarc=pass (policy=none) header.from=sibptus.ru; spf=pass (mx1.freebsd.org: domain of vas@sibptus.ru designates 2001:19f0:5001:21dc::10 as permitted sender) smtp.mailfrom=vas@sibptus.ru X-Spamd-Result: default: False [-7.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[sibptus.ru:s=20181118]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; SUBJECT_ENDS_QUESTION(1.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[sibptus.ru:+]; DMARC_POLICY_ALLOW(-0.50)[sibptus.ru,none]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[192.168.1.74]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5000::/38, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-3.22)[ip: (-9.89), ipnet: 2001:19f0:5000::/38(-4.94), asn: 20473(-1.20), country: US(-0.05)]; SH_EMAIL_ZRD(0.00)[192.168.1.74] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2020 14:55:42 -0000 --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Victor Sudakov wrote: > > It looks like CUPS works by using an internal texttopdf converter > > and feeding to to pdftops. > >=20 > > Installing cups-filters (quite a small package) makes this work > >=20 > > cupsfilter Documents/UTF-8-demo.txt > t.ps > >=20 > > The resultant file views and prints fine. >=20 > Dear Steve,=20 >=20 > You are a wizard! cupsfilter really works. > "cupsfilter test.txt | lpr -P ps" printed a fine Cyrillic page for me. >=20 > It seems that cupsfilter requires CUPS to be installed but it does not > have to be running. I can live with that. I can probably use cupsfilter > as a filter in printcap combining it with gs, to emulate a line printer. >=20 So, my final working printcap looks this: lp|Brother HL-L2340D series line printer:\ :sh:\ :lp=3D9100@192.168.1.74:\ :if=3D/usr/local/etc/txt2pcl.sh:\ :sd=3D/var/spool/output/lpd1:lf=3D/var/log/lpd-errs: 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: The txt2pcl.sh filter looks this: #!/bin/sh exec 2> /dev/null /usr/local/sbin/cupsfilter -i text/plain - |\ /usr/local/bin/gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER \ -sDEVICE=3Dhl1250 -sPAPERSIZE=3Da4 -r600x600 \ -sOutputFile=3D- - && exit 0 Thanks again Polytropon, Steve and all who helped. --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --neYutvxvOLaeuPCA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJess/rAAoJEA2k8lmbXsY0BaYIAKBdDs/y1MJUJimUkDApqnWX neHEQzsJuG4cC6t1IpXAeP8o96UO62GH5FKbsoBner/DNvR+2qnPdKiY3TRDQCeq Ti6Hk2MhkSwTKzhUHFH5V+HDRhyOaWrjlgrsotDi0jT4aQsHVEEkzpH3o8IA5U+a AG7uLTRz5ojoM5Kz+J90fgzcJJfa4K8amxl896AGS1NzLB7YfKlXYmHK22BiJzJa c8Zy4mSltblX+Q7jFxtlkX/VCePEvz2Z6flZ8eG+QgRiHDyU+in7SszJrxV51AQo WMRBBu9pd0HXfmQaUVYjWpuHJp6S9C4hJ2AIfc1bh/L38lJb+5cfrQ0Sn/QGyeU= =mdrU -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA--