Lines being wrapped to new line

Helge Blischke h.blischke at acm.org
Tue Mar 15 05:10:03 PDT 2011


derick de waal wrote:

>> derick de waal wrote:
>>
>> >> derick de waal wrote:
>> >>
>> >> > Hi all.
>> >> > We are in the process of moving from Sco to Red Hat.
>> >> > I have installed Cups and I'm struggling with the following issue.
>> >> > My lines contain 154 characters. On the Jet printers lines are
>> >> > wrapped from approx character 130 and rest of line is printed on a
>> >> > new line. On the dot matrix printer is wraps from character 88. How
>> >> > do I correct this? Any help will be appreciated
>> >>
>> >> You need to tell more details on how these printers are configured in
>> >> CUPS, ans what version of CUPS you are using.
>> >>
>> >> Helge
>> >>
>> >
>> > Hi Helge.
>> > I have installed Cups 1.3.7.
>> > I have connected to the printers via IP's on cups. Test pages print
>> > fine. Jet printer is Xerox Workcentre 4150
>> > Printer Driver: Xerox Generic
>> > Device URI: socket://196.1.50.31
>> > lpi=8 cpi=17 landscape=true
>> >
>> > Dot Matrix printer is Oki 395.
>> > Printer Driver: Oki 24-Pin Series, 1.3
>> > Device URI: socket://196.1.39.95
>> > lpi=8 cpi=12
>>
>> I vaguely remember that the texttops filter had issues with line
>> wrapping. Try the option
>> wrap=false
>> in addition.
>>
>> If that does not work, I could provide you with a line printer emulator
>> written in PostScript (which I originally developed to print mainframe
>> print jobs to A4 paper).
>>
>> Helge
>>
> Hi Helge.
> I have tried the wrap=false option however it did not work. I also tried
> the following with no success.
> 
> Turning Off Text Wrapping
> 
> The -o nowrap option disables wrapping of long lines:
> 
> lp -o nowrap filename
> lpr -o nowrap filename
> 
> 
> If you could provide me with the line printer emulator I would appreciate
> it. My mail adress is ddewaal at tfd.co.za
> Kind Regards
> Derick.

Derick,

attched is the Perl script which acts as a filter to handle documents of format text/plain and friends.
Put it into CUPS' filter directory (usually /usr/lib/cups/filter/) and add a file, say, lp.convs, into your /etc/cups directory, which contains the following line:

text/plain	application/postscript	10	lptops

Similarly add lines for all the document formats that request the texttops filter as specified in mime.convs if needed.
(as CUPS reads the .convs files as well as their contents lexically sorted, lp.convs must be lexically precede mime.convs; if that isn't enough, you need to comment the 
text/plain line in mime.convs).

The filter script itself needs no external configuration data. There are only a few paramters which could be
adjusted if needed:

$lpfont		the font used to render the plain text. Default is Courier, but you could replace it by any other
				font resident on the printer. Even if the font is not "fixed pitch", it will be treated as such
$cpline		the number of characters per line. Default is 132. The character width will be adjusted so that
				$cpline characters fit into one line.
$cpi2lpi		the factor by which the CPI (characters per inch) value computed from the characters per line
				is multiplied to get the corresponding LPI (lines per inch) value. The default is 0.6 .
$mrg		the additional margin in 1/10". The printer's built-in margin(s) are extended by this value
				(default 3/10"). The printer's hardware margins are evaluated by the PostScript program 
				itself.

This filter only renders plain text (and assumes ISO 8859-1 aka Latin1 encoding). The only control characters
which are interpreted are CR, LF, CRLF (all three treated as line endings identically), FF (interpreted as 
form feed) and TAB (default: 64 tab positions 8 character widths apart).

There is no line wraqpping, prettyprinting, headers and footers or the like.

You could contact me directly if there are questions left at 
h dot blischke at acm dot org

Helge


 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lptops
Type: application/x-perl
Size: 16743 bytes
Desc: not available
URL: <https://lists.cups.org/pipermail/cups/attachments/20110315/dcc74059/attachment.bin>


More information about the cups mailing list