The Open Source Swiss Army Knife

/unix/
/unix/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /unix 
Permalink: printing.htm
Title: printing a simple ascii file requires ghostscript!
article options : please login   |  print view

  1. lpr conf file
  2. no line wrap a2ps, lpr, fmt, enscript

lpr conf file

NEC:
     :lp=/dev/lpt0:sd=/var/spool/output/NEC:lf=/var/log/lpd-errors
su root
cd /var/spool/output
mkdir NEC
chown bin NEC
chgrp daemon NEC
chmod 755 NEC

no line wrap: a2ps, lpr, fmt, enscript

a2ps

It was recommended that to wrap long lines that I try out a2ps.

Wow! it didn't output anything to me it output to the default printer.

Wow! It split the page in half, and printed landscape!

Now, where can I find out what is my default printer?

Now, how can I change the default printer used by a2ps? doh! -P.

And to show that it can also print multiple files:

          $ a2ps -P lw --toc src/*

     To process  the  files  `sample.ps'  and  `sample.html'  and
     display the result,

          $ a2ps -P display sample.ps sample.html

and a2ps does wrap linees:
a2ps test_copy_filename.c
[test_copy_filename.c (C): 1 page on 1 sheet]
request id is flat-217 (1 file)
[Total: 1 page on 1 sheet] sent to the default printer
[1 line wrapped]
Here is another example of printing out to a directory using syntax like that just above (for the 'a2ps' command)
assign3 a2ps -P flat --toc print/*
[print/LINT (plain): 3 pages on 2 sheets]
[print/makefile (Makefile): 1 page on 1 sheet]
[print/part3_out.txt (plain): 1 page on 1 sheet]
[print/part5_out.txt (plain): 1 page on 1 sheet]
[print/part7_out.txt (plain): 1 page on 1 sheet]
[print/part8_9_out.txt (plain): 3 pages on 2 sheets]
[print/pipe_utility.c (C): 2 pages on 1 sheet]
[print/program_client.c (C): 3 pages on 2 sheets]
[print/program_server.c (C): 5 pages on 3 sheets]
[print/program_utility.c (C): 4 pages on 2 sheets]
[print/restart.c (C): 4 pages on 2 sheets]
[print/show_programs.c (C): 3 pages on 2 sheets]
[print/test_part3.c (C): 1 page on 1 sheet]
[print/test_part5.c (C): 1 page on 1 sheet]
[print/test_part7.c (C): 1 page on 1 sheet]
request id is flat-465 (1 file)
[Total: 35 pages on 24 sheets] sent to the printer `flat'
[116 lines wrapped]
assign3 

and it ignored the font-width specification, what the hell is width option ignored
NAME
     a2ps - format files for printing on a PostScript printer

SYNOPSIS
     a2ps [OPTION]... [FILE]...

DESCRIPTION
     Convert FILE(s) or standard input to PostScript.

lpr

[1 line wrapped]

maybe just lpr -w cols?? (solaris man lpR)

lpr -P flat -w 80 test_copy_filename.c ME
     enscript - convert text files to PostScript


YNOPSIS
     enscript [-12BcgGhjkKlmOqrRvVzZ] [-# copies] [-a pages]  [-A
     align]   [-b   header]  [-C[start_line]]  [-d  printer]  [-D
     key[:value]]   [-e[char]]   [-E[lang]]   [-f    font]    [-F
     header_font]  [-H[num]]  [-i  indent] [-I filter] [-J title]
     [-L lines_per_page] [-M media] [-n copies] [-N newline]  [-o
     outputfile]  [-o  -] [-p outputfile] [-p -] [-P printer] [-s
     baselineskip]  [-S  key[:value]]  [-t  title]  [-T  tabsize]
     [-u[text]]  [-U  num]  [-W language] [-X encoding] [filename
     ...]

Warning: width option ignored as the pr filter option was not specified

fmt

It will take me a while to understand why fmt text > text makes text an empty file whereas fmt text sends oodles of output to the screen!

enscript

NAME
     enscript - convert text files to PostScript

SYNOPSIS
     enscript [-12BcgGhjkKlmOqrRvVzZ] [-# copies] [-a pages]  [-A
     align]   [-b   header]  [-C[start_line]]  [-d  printer]  [-D
     key[:value]]   [-e[char]]   [-E[lang]]   [-f    font]    [-F
     header_font]  [-H[num]]  [-i  indent] [-I filter] [-J title]
     [-L lines_per_page] [-M media] [-n copies] [-N newline]  [-o
     outputfile]  [-o  -] [-p outputfile] [-p -] [-P printer] [-s
     baselineskip]  [-S  key[:value]]  [-t  title]  [-T  tabsize]
     [-u[text]]  [-U  num]  [-W language] [-X encoding] [filename
     ...]

This sounds best yeet! I can output to a file and view the ghostscript, non?

I can then view the files with gs out.ps.


Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top