# ASCII To PostScript Converter

Topics

:

Overview
Usage

Overview

The ASCII to PostScript utility is a console-based program used to convert text documents to PostScript documents suitable to send to a PostScript printer.

Usage

To use the ASCII to PostScript utility enter the name of the program followed by the name of the text file to convert. The program will writes to the console to by default.

    as2ps myfile.txt (Write to console)

    as2ps myfile.txt myfile.ps (Write to myfile.ps file)

    as2ps myfile.txt | lp -d hplj (Pipe to a PostScript Printer)

    as2ps myfile.txt > LPT1 (Redirect to a PostScript Printer)

    as2ps myfile.txt > myfile.ps (Redirect to file)

You can pass one of several document format switches to the program from the command line. From the command line you can use a wildcard to specify a group of files, for example: *.txt would convert all files in the current directory that have a .txt extension. For a list of format switches execute the program with no arguments or with a "-?" argument: "as2ps" or "as2ps -?"

    ASCII to PostScript Converter version 4000.101
    Usage: as2ps [switches] infile.txt
    Switches: -?      = Display this help message.
              -c#     = Number of copies to print. Example: -c2
              -d      = Enable duplex printing if available.
              -D      = Print from manual feed position.
              -fcode  = Select a font type. Example: -fC
              -F      = Write output to a file: infile.txt = infile.ps
              -h      = Use page headers and numbers.
              -H      = Use page headers and numbers with lines.
              -l      = Print in landscape mode instead of portrait.
              -m#     = Set left and right margins. Example: -m1.0
              -M#     = Set top and bottom margins. Example: -M1.0
              -pcode  = Select a paper size. Example: -pLET
              -s#     = Specify font size. Example: -s10.0
              -t#     = Spaces between tab stops. Example: -t8
              -T      = Do not truncate lines that exceed margin.
              -u      = Format UNIX man pages produced by nroff.
              -v      = Turn verbose mode on.
              -W      = Turn line wrap on.
              -y#     = Use a specified paper tray. Example: -y1

    Valid font codes for -f option:

    	C - Courier, CB - Courier-Bold, CO - Courier-Oblique,
    	CBO - Courier-BoldObligue, T - Times-Roman, TB - Times-Bold
    	TI - Times-Italic, TBI - Times-BoldItalic, H - Helvetica
    	HBO - Helvetica-BoldOblique, HO - Helvetica-Oblique,
    	HB - Helvetica-Bold,  S - Symbol

    Valid paper codes for -p option:

    	LET - Letter size  8.5 x 11 inches
    	LEG - Legal size   8.5 x 14 inches
    	TAB - Tabloid size 11 x 17 inches
    	A3  - A3 size 297mm x 420mm (11.70 x 16.55 inches)
    	A4  - A4 size 210mm x 297mm (8.27 x 11.70 inches)

The "-c" switch is used to select the number of copies to print: "as2ps -c2 myfile.txt" will print two full copies of the document. The default is one copy per document.

The "-d" switch is used to enable duplex printing if a duplex device is attached to the printer. Each pair of consecutive pages will be printed on opposite sides of a single sheet of paper.

The "-D" switch is used to feed the paper from the printer's manual feed position.

The "-f" switch is used to select a specified font code. "asps -fT myfile" will print the document using the Times-Roman font. The default font is Courier. Other font codes include:

C - Courier, CB - Courier-Bold, CO - Courier-Oblique, CBO - Courier-BoldObligue
T - Times-Roman, TB - Times-Bold TI - Times-Italic, TBI - Times-BoldItalic
H - Helvetica, HBO - Helvetica-BoldOblique, HO - Helvetica-Oblique, HB - Helvetica-Bold
S - Symbol

The "-F" switch is used to write the output to a file instead of the console. The resulting PostScript file will use the same name as the text file with a ".ps" file extension. NOTE: Existing PostScript files in the program's working directory with the same name will be overwritten without prompting.

The "-h" switch is used to print a page header and a page number on each page. A page header is made up of the text file name and the current system time and date. NOTE: When selected, this option will use one-inch left/right margins and one-inch top/bottom margins.

The "-H" switch is used to print a page header and a page number on each page; both separated from the text by a line. A page header is made up of the text file name and the current system time and date. NOTE: When selected, this option will use one-inch left/right margins and one-inch top/bottom margins.

The "-l" switch is used to select landscape mode instead of portrait. The default is portrait mode.

The "-m" switch is used to set the left and right margins: "as2ps -m1.0 myfile.txt" will print the document with one-inch left and right margins. The default is none. NOTE: If the right margin is exceeded the line will be truncated unless a "-T" switch is given.

The "-M" switch is used to set the top and bottom margins: "as2ps -M1.0 myfile.txt" will print the document with one-inch top and bottom margins. The default is none.

The "-p" switch is used to select a specified paper size: "as2ps -pTAB myfile.txt" will format the document for Tabloid size paper. The default paper size if Letter size. Other paper codes include:

LET - Letter size 8.5 x 11 inches
LEG - Legal size 8.5 x 14 inches
TAB - Tabloid size 11 x 17 inches
A3 - A3 size 297mm x 420mm (11.70 x 16.55 inches)
A4 - A4 size 210mm x 297mm (8.27 x 11.70 inches)

The "-s" switch is used to specify a font size: "as2ps -s12 myfile.txt" will format the document using a 12-pitch font. The default font size is 10 pitch.

The "-t" switch is used to set the number of spaces between tabs. The default tab size is eight.

The "-T" switch is used to ensure that lines exceeding the right margin will not be truncated.

The "-u" switch is used to format UNIX man pages produced by nroff.

The "-v" switch is used to turn verbose mode on. In verbose mode the program will echo the document parameters to the screen before printing. This option is used for troubleshooting print jobs.

The "-W" switch is used to line wrap on. This will force any lines that exceed the right margin to wrap around the page.

The "-y" switch is used to specify a paper tray: "as2ps -y1 myfile.txt" will print the file to tray number one on the printer. The correspondence between tray numbers and the actual paper tray positions is specific to each printer.

End Of Document