Print Text Files Amongst Multiples Pages Per Sheet

a2ps is the venerable tool for formatting text files for Postscript printers. This postal service focuses on how to telephone phone a2ps to impress multiple pages per sheet.

To install a2ps in addition to gv aka ghostview, which a2ps uses to preview output files:

 $ sudo apt-get install a2ps $ sudo apt-get install gv 

Layout

You tin flame layout a canvas of newspaper into rows in addition to columns of pages.

To impress the emacs config file inwards the higher upwards format, whatsoever of the next volition do:

 $ a2ps  /.emacs $ a2ps --rows 1 --columns two  /.emacs $ a2ps -2  /.emacs 

Note that amongst no explicit instruction, the default layout is 1x2 inwards the landscape orientation.

a2ps provides shortcuts to specify the break of rows in addition to columns for mutual configurations. For example, -2 is equivalent to 1 row in addition to two columns. Valid shortcuts are -1 to -9.

Paper size

North American a2ps users require to modify the output newspaper size. a2ps was written inwards Europe, in addition to uses A4 every bit the default newspaper size. North America uses a dissimilar standard, in addition to a mutual newspaper size is called Letter - 8.5 x xi inches. Printing A4 on Letter-sized newspaper results inwards text existence cropped at the terminate of each business inwards the correct column.

To modify the newspaper size to Letter:

 $ a2ps -M Letter .emacs 

Instead of overriding the newspaper size inwards every unmarried run, yous tin flame alter the default locally (per user) or globally (system-wide). To specify the newspaper size for a user, add together the next business to $HOME/.a2ps/a2psrc.

 Options: --medium=Letter 

To alter the default system-wide, edit the file /etc/a2ps-site.cfg. Look for the Options: --medium business in addition to alter the value to Letter.

Preview of output

By default, a2ps sends the output to the printer. Sometimes yous desire to override that conduct inwards guild to preview the output. You may redirect the output to a PostScript file or straight to ghostview.

To hit a PostScript output file, in addition to opened upwards it using ghostview:

 $ a2ps -o temp.ps -M Letter .emacs [.emacs (plain): 31 pages on sixteen sheets] [Total: 31 pages on sixteen sheets] saved into the file `temp.ps' [101 lines wrapped] $ gv temp.ps 

a2ps provides a shortcut to preview its output straight inwards ghostview.

 $ a2ps -P display -M Letter .emacs 

The -P parameter unremarkably specifies the printer name. However, display is a exceptional refer to redirect output to ghostview.

Multiple files

a2ps also supports multiple input files. By default, each file begins printing on a novel canvas ("file alignment"). Empty cells inwards the layout are non filled. For example, given two input files - 1.txt in addition to 2.txt - that are each 1 page long, each file volition live on printed on a assort sheet, leaving the sheets one-half empty.

You tin flame command the file alignment using -A parameter. If file alignment is fill, a2ps prints a file kickoff inwards the adjacent available cell, leaving no empty jail cellular telephone inwards betwixt it in addition to the previous file.

 $ a2ps -A hit amount  1.txt 2.txt [1.txt (plain): 1 page on 1 sheet] [2.txt (plain): 1 page on 1 sheet] asking id is ML-1640-Series-162 (0 file(s)) [Total: two pages on 1 sheet] sent to the default printer 

a2ps has also many useful features to live on covered inwards a unmarried post. Read the man page if yous desire to impress double-sided, or yous desire to break each business inwards the output.

Berlangganan update artikel terbaru via email:

0 Response to "Print Text Files Amongst Multiples Pages Per Sheet"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel