Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Beeblebrox
Enscript does not support UTF-8 formatted text files, so it's not usable in
this case.

One solution, is to use paps, instead of Enscript, for converting UTF-8
encoded text to PostScript.
http://www.linuxfromscratch.org/blfs/view/svn/pst/enscript.html

Another (which I prefer) solution is to send to printer like this (with n
being the 8859 extension number):
$ iconv -f UTF-8 -t ISO-8859-n file-UTF8.txt | enscript --encoding=8859n |
lpr -Pprinter

Thanks to Martin Paredes for this suggestion.

Perhaps this information or the appropriate enscript conversion code for
psif could be included in the Handbook
(https://www.freebsd.org/doc/handbook/printing-lpd.html 10.5.3.4 /
10.5.3.5)?

Regards.



-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561p5956648.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Matthias Apitz
El día Tuesday, October 14, 2014 a las 01:19:42AM -0700, Beeblebrox escribió:

 Enscript does not support UTF-8 formatted text files, so it's not usable in
 this case.
 
 One solution, is to use paps, instead of Enscript, for converting UTF-8
 encoded text to PostScript.
 http://www.linuxfromscratch.org/blfs/view/svn/pst/enscript.html
 
 ...

We are using in production environments CUPS in the version 1.4.3; this
has a component 'texttops' which supports UTF-8 encoded text (only) and
prints UTF-8 nicely on the fly.

We have a special enhancement of the used fonts to support most EU
languages.

HIH

matthias

-- 
Matthias Apitz   |  /\   ASCII Ribbon Campaign:
E-mail: g...@unixarea.de |  \ /   - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X- No proprietary attachments
phone: +49-170-4527211   |  / \   - Respect for open standards
 | en.wikipedia.org/wiki/ASCII_Ribbon_Campaign
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Beeblebrox
 We are using in production environments CUPS in the version 1.4.3;
 this has a component 'texttops' which supports UTF-8 encoded text
 (only) and prints UTF-8 nicely on the fly.

Thanks for the input.
Unfortunately, CUPS has been broken for me since May/14.
(http://freebsd.1045724.n5.nabble.com/print-cups-base-web-interface-broken-amp-unable-to-print-td5918098.html#a5922974)

Installed CUPS components:
cups-base-1.7.3_1, cups-client-1.7.3_2, cups-image-1.7.3_1, cups-pdf-2.6.1_1, 
cups-pstoraster-8.15.4_8, gutenprint-cups-5.2.10

Regards.




-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561p5956658.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Matthias Apitz
El día Tuesday, October 14, 2014 a las 02:26:37AM -0700, Beeblebrox escribió:

  We are using in production environments CUPS in the version 1.4.3;
  this has a component 'texttops' which supports UTF-8 encoded text
  (only) and prints UTF-8 nicely on the fly.
 
 Thanks for the input.
 Unfortunately, CUPS has been broken for me since May/14.
 (http://freebsd.1045724.n5.nabble.com/print-cups-base-web-interface-broken-amp-unable-to-print-td5918098.html#a5922974)
 
 Installed CUPS components:
 cups-base-1.7.3_1, cups-client-1.7.3_2, cups-image-1.7.3_1, cups-pdf-2.6.1_1, 
 cups-pstoraster-8.15.4_8, gutenprint-cups-5.2.10

This is one of the reasons we stick with 1.4.3.

matthias
-- 
Matthias Apitz   |  /\   ASCII Ribbon Campaign:
E-mail: g...@unixarea.de |  \ /   - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X- No proprietary attachments
phone: +49-170-4527211   |  / \   - Respect for open standards
 | en.wikipedia.org/wiki/ASCII_Ribbon_Campaign
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Beeblebrox
@Matthias:
 This is one of the reasons we stick with 1.4.3.

How? Did you create a self-maintained port for it?
How did you overcome the problem of CUPS-dependent ports pulling in 1.7.3 in 
poudriere?

Regards.




-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561p5956672.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Matthias Apitz
El día Tuesday, October 14, 2014 a las 03:07:10AM -0700, Beeblebrox escribió:

 @Matthias:

I'm not '@Matthias', but Matthias, and I think, the @ sign is normaly
used to express user@host or @domain;

  This is one of the reasons we stick with 1.4.3.
 
 How? Did you create a self-maintained port for it?
 How did you overcome the problem of CUPS-dependent ports pulling in 1.7.3 in 
 poudriere?

I compile it directly from source, also on non-FreeBSD hosts (Linux and
SPARC) and ship it to our customers.

matthias
-- 
Matthias Apitz   |  /\   ASCII Ribbon Campaign:
E-mail: g...@unixarea.de |  \ /   - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X- No proprietary attachments
phone: +49-170-4527211   |  / \   - Respect for open standards
 | en.wikipedia.org/wiki/ASCII_Ribbon_Campaign
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Don Lewis
On 14 Oct, Beeblebrox wrote:
 We are using in production environments CUPS in the version 1.4.3;
 this has a component 'texttops' which supports UTF-8 encoded text
 (only) and prints UTF-8 nicely on the fly.
 
 Thanks for the input.
 Unfortunately, CUPS has been broken for me since May/14.
 (http://freebsd.1045724.n5.nabble.com/print-cups-base-web-interface-broken-amp-unable-to-print-td5918098.html#a5922974)
 
 Installed CUPS components:
 cups-base-1.7.3_1, cups-client-1.7.3_2, cups-image-1.7.3_1, cups-pdf-2.6.1_1, 
 cups-pstoraster-8.15.4_8, gutenprint-cups-5.2.10

I think it also broke for me around that timeframe until I found that I
also needed cups-filters.

cups-base-1.7.3_1  Common UNIX Printing System: Server
cups-client-1.7.3_2Common UNIX Printing System: Library cups
cups-filters-1.0.58Backends, filters and other software (was part 
of the core CUPS)
cups-image-1.7.3_1 Common UNIX Printing System: Library cupsimage
cups-pstoraster-8.15.4_8   Postscript interpreter for CUPS printing to 
non-PS printers
gutenprint-cups-5.2.10 GutenPrint Printer Driver
libgnomecups-0.2.3_6,1 Support library for gnome cups administration

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: printing text file with LPD - non-printable characters

2014-10-14 Thread Beeblebrox
@Don:

 I think it (cups) also broke for me around that timeframe until I
 found that I also needed cups-filters.

You sir, are a life saver! Thank you for the tip.
[SOLVED]




-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561p5956782.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


printing text file with LPD - non-printable characters

2014-10-05 Thread Beeblebrox
I have two LPD errors
1. I see two characters being replaced by strings on the hard copy (the {â}
below is an {a^}). This happens on the first page and not on following
pages.
instead of  I get:  â\200\234 (235 for trailing )
instead of ' I get:  â\200\231
2. All non-english characters get garbled, on all pages. These are
characters like ç, ö, etc.

With these two seemingly separate errors, I can't figure out whether this is
an lpr or enscript error.

* The file being sent through lpr is a simple text file.
* /etc/printcap entry for default printer is:
   lp|hp2100|HP 2100TN:\
   :rm=192.168.1.9:rp=raw:\
   :if=/usr/local/libexec/filters/psif:\
   :lf=/var/log/lpd-filter-errs:\
   :sd=/var/spool/lpd/hp2100:\
   :mx=0:sh:
* /var/log/lpd-filter-errs shows: [ 4 pages * 1 copy ] left in -  \  59
lines were wrapped  \  7 non-printable characters
* filetrs/psif is also very basic:
#!/bin/sh
IFS= read -r first_line
first_two_chars=`expr $first_line : '\(..\)'`
case $first_two_chars in
%!)
# %! : PostScript job, print it.
echo $first_line  cat  exit 0
exit 2
;;
*)
# otherwise, format with enscript
( echo $first_line; cat ) | /usr/local/bin/enscript -o -  exit 0
exit 2
;;
esac




-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: printing text file with LPD - non-printable characters

2014-10-05 Thread Matthias Apitz
El día Sunday, October 05, 2014 a las 10:41:43AM -0700, Beeblebrox escribió:

 I have two LPD errors
 1. I see two characters being replaced by strings on the hard copy (the {â}
 below is an {a^}). This happens on the first page and not on following
 pages.
 instead of  I get:  â\200\234 (235 for trailing )
 instead of ' I get:  â\200\231
 2. All non-english characters get garbled, on all pages. These are
 characters like ç, ö, etc.
 
 With these two seemingly separate errors, I can't figure out whether this is
 an lpr or enscript error.

First of all check, what encoding has your text file, UTF-8 or ISO or
...?

Then run the file through the filter

$ /usr/local/bin/enscript -o -  file  out

and check the resulting file 'out'.

I do not know enscript, but guess that it should produce Postscript from
your input file.

I moved the thread by setting Reply-To: to the normal freebsd-question@
list;

matthias
-- 
Matthias Apitz   |  /\   ASCII Ribbon Campaign:
E-mail: g...@unixarea.de |  \ /   - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X- No proprietary attachments
phone: +49-170-4527211   |  / \   - Respect for open standards
 | en.wikipedia.org/wiki/ASCII_Ribbon_Campaign
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

printing text file with LPD - non-printable characters

2014-10-05 Thread Beeblebrox
@Matthias:
 I moved the thread by setting Reply-To: to the normal
 freebsd-question@ list;
I'm using the nabble interface, so if the move does not work.. (I've never 
tried with moved thread before).

 First of all check, what encoding has your text file, UTF-8 or ISO or
$ file print.txt   UTF-8 Unicode text, with very long lines
 
 Then run the file through the filter
Thanks for that idea - helped narrow down the problem to enscript:
$ enscript mytext.txt -o filter.txt
[ 4 pages * 1 copy ] left in ens.txt
59 lines were wrapped
7 non-printable characters
Resulting file has same encoding errors as hard copy.

* I should also mention that I tried this from both Desktop and from tty* with 
same results.
* Will any environment settings affect this? The only relevant entry is: 
LANG=en_US.UTF-8

Regards.
-- 
FreeBSD_amd64_11-Current_RadeonKMS




-
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/printing-text-file-with-LPD-non-printable-characters-tp5954561p5954593.html
Sent from the freebsd-current mailing list archive at Nabble.com.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org