Porting Central
Skip to main content

Porting Central

ezprint: Printing EZ Documents

What ezprint Is

ezprint prepares ATK document files (created using the EZ editor) for printing and then prints them.

Quick Reference

To print out an EZ file, type the command "ezprint" followed by the name of the file you want to print:

ezprint filename

Using the ezprint command with the name of a file from the command prompt is the same as selecting the Print pop-up menu command from the File menu card in EZ, or the Print command from the Preview menus.Printing multiple files. You can print more than one file with a single ezprint command by separating filenames with a space. When you want to print files in other directories, use pathnames. For example, to print a copy of your preferences file from your home directory and a copy of the file "draft.1" from the subdirectory "work," you would type the following command from your home directory:

ezprint preferences work/draft.1

Options

Any of these print options that you want to use must come before the name of the file you want to print. If you print multiple files, each file is affected by all the options that appear before it in the command line.

-P printername The -P option, followed by a printer name, prints your document on the printer you choose. This option is similar to the "print -P" option. For example, to print a document named "termpaper" on a printer called "sycamore," you would use the following command:

ezprint -P sycamore termpaper

-o name The "-o" option, plus a name or a message, allows you to specify a new name or message to be printed in the "File:" line on the cover page of a printout. If you do not specify a new name or message for the file, ezprint by default lists the original filename. If you have a multi-word message, do not separate words with spaces but with some character, like underscore, or use quotes around "sample string". For example,

ezprint -o sample_string filename

-O name The same as -o.

-p The "-p" option allows you to send formatted output from ezprint directly to a previewing program from a command line. Use the following command line, substituting in the name of your file, and then press Enter to preview a file:

The following options apply only to text documents being printed (not figures, rasters, or other kinds of documents):

-c The "-c" option tells ezprint to produce the table of contents.

-E The "-E" option tells ezprint to automatically enumerate the table of contents entries, if any, when printing. (See the ez-contents help file for information about creating a table of contents.) You can force ezprint to always enumerate the table of contents with the AutoEnumerate:true preference.

-cn The "-cn" option tells ezprint to override any preference set to print a table of contents (PrintContents:yes) and not print a table of contents.

-N The "-N" option lets you set a starting chapter number for the table of contents.

-C "style1,style2" The "-C" option specifies the styles that will be looked for and put into the table of contents. (See the ez-contents help file for information about creating a table of contents.) The default styles are "chapter,section,subsection,paragraph,function." So, to specify that "Heading" and "SubHeading" be included in the table of contents, and not any of the text in the default styles, you would use

ezprint -c -C "heading,subheading" filename

You can also set the default via a ContentsList preference.

-I The "-I" option specifies that only an index for the give file be printed. See the ez-index help file for more information on creating and using an interactive index.

-F The "-F" option specifies that footnote insets in an EZ file should be printed at the bottom of the page. This is the default behavior. See the ez-footnotes help file for more information on creating footnotes.

-FE The "-FE" option specifies that footnotes insets in an EZ file should be printed as end notes. See the ez-footnotes help file for more information on creating footnotes.

The following arguments are for advanced users:

-s The "-s" option tells ezprint to read input from stdin.

-L The "-L" option causes the document to print in landscape mode. This option only works if the PostScript printing mechanism is being used ("-M ps").

-% number The "-%" option causes the document to be scaled to the given percentage. The default is "-% 100". This option only works if the PostScript printing mechanism is being used ("-M ps").

-g papersize The "-g" option sets the paper size that the document will be formatted for. The default is "letter". You may specify "letter", "legal", "a4", "folio", and other common terms; you may also specify dimensions in inches, e.g. "8x10", or in centimeters, e.g. "20x30c". This option only works if the PostScript printing mechanism is being used ("-M ps").

-z The "-z" option tells ezprint to Zap (delete) the file when it is done printing and the print appears to have been successful. This option also causes ezprint to lock the file when it opens it for reading with flock; thus an application can safely collect things to be printed in a file and periodically queue them for printing, relying on the flock (which the application must also do) to ensure that both duplicate prints and missing prints due to timing errors do not occur. If the print request fails, the file is renamed to PrintErr.xxx (for some not-previously-existing version of xxx) in the same directory.

-v ScribeVersion The "-v" option, plus a version string, allows you to print files in the old Scribe-like datastream that was sometimes used by BE1 applications and the messages program. The only reasonable options for "ScribeVersion" are "yes" and "2". It is unlikely that this option will be useful to anything other than the messageserver printing old-format mail and bboard messages.

ezprint -T "-n10 -o12-15" p.doc

-e <foo=bar> The "-e" option sets the environment variables specified.

-q The "-q" option tells ezprint to run without displaying of the ATK version message.

Changing ezprint Defaults

There are no options available for ezprint which allow you to override EZ defaults and change the appearance of your document only at the time it is printed. All changes to the appearance of your document must be made either in the EZ document itself or in the EZ preferences stored in your preferences file. To change the printing font used by ezprint, you must change the ez.bodyfont preference because EZ documents are printed in the same font in which they appear on the screen. See the preferences section of the ez help document for details.

How ezprint Works

If you are interested in how ezprint works, there is a document describing it in the Andrew sources; in andrew/atk/ezprint/printing.ins.

Related Topics