Command Line Interface: ecprint


The information provided below applies to the UNIX versions of EasyCopy.

Use the ecprint command to start EasyPrint as a command line program.

EasyPrint is the printing program of EasyCopy. It is called automatically when you create a print job in the graphical user interface (Print dialog). Printer selection, printer setup, and page layout options are specified by using the various dialogs and transferred together with image data from the graphical user interface to EasyPrint.

ecprint is used to create the ready-to-print data stream for the selected printer. It is invoked silently, when files are submitted from the Graphical User Interface, or when an application is printing using the lp or lpr command for a print queue setup by EasyCopy for print queue processing.

The program can also be used alone. Its command line interface gives you the same control as the graphical user interface.

ecprint creates a data stream which is ready to print. It does not send this data stream to the print queue. When you use ecprint from the command line you must direct its output data stream to lp or lpr to create print jobs.

Supported Formats

ecprint detects if the input file is supported. Any file that can be opened by EasyCopy is supported, except graphics. This includes:
Raster image files
 
Graphics files
Requires the licensable option EasyCGM.
 
PDF files
Uses the Ghostscript filter.
 
PostScript files
If the current printer is a PostScript printer it sends the file directly to the printer. Otherwise the Ghostscript filter is used.
 
Compressed files
Uses the decompression filters.
 
ASCII text files
(uses the ASCII to PostScript filter);
In addition to these file types ecprint supports Print Job files (these files are prepared for ecprint by the graphical user interface or by ecprint itself).

If the file is not recognized as a supported type ecprint lets the file pass unmodified. A warning message is given only if the informational option -warning true has been specified.

Command syntax

The command line syntax is as follows:

  ecprint [options] [@response-file] [in-file [out-file]]  

The ecprint program uses right-to-left precedence: if an option is duplicated the value supplied with the one that is last specified (right most) is used.

Any of the options for absolute or relative image size (-size or -scalefactor) are duplicates. The one specified last counts. Similarly, options for absolute or relative image position (-horizontal and -vertical, or -offset) are duplicates.

If two options contradict each other ecprint displays an error message and terminates. This may happen if the specified options violate constraints expressed in the printer description file.

Options and parameters (apart from path and queue names) may be entered with uppercase and lowercase letters and with underscores between "words." Letters are converted to lowercase and underscores are removed during parsing. For example, the following are all interpreted identically:-PageSize, -pagesize, -page_size, or -Pagesize.

Options and parameters (apart from path and host names) can be abbreviated as long as they can be unambiguously identified. For example, -unit can be abbreviated -un.

It may happen, that an abbreviation is valid for one printer and ambiguous for another printer because of different printer specific options.

If an option is not supplied in the command line, a default value applies. The default parameters originate (in order of precedence) from three sources:

  1. Your private initialization file
  2. The system-wide initialization file created by system administrator
  3. Factory defaults embedded in the software
Refer to the topic
Scope of Options for further information.
Help listing
The current default options can at any time be determined from the help list. Use the -help option to get this list:

 $ ecprint -help


 Copyright (c) 2002 AutoGraph International Inc.
 Copyright (c) 2002 Augrin Software ApS.
 All rights reserved.
 -----------------------------------------------
  ecprint [options] [@<response-file>] [<in-file>[<out-file>]]

# Basic Options
  -printer <printer>  overrides PRINTER.
  -printqueue <printqueue>  selects printer by queue name.
  -sysdir <sysdir>  overrides SYSDIR. /opt/easycopy/system is default
  -tmpdir <tmpdir>  overrides TMPDIR. /usr/tmp is default
  ...
For choice options the leftmost choice is the default. For value options the range is shown, and the default is written explicitly in the help listing:

  ...
  -unit {inches | millimeters | dots | points}
  -scalefactor <1-100> 100 percent is default
  ...
-unit is a "choice option" and inches is default.

-scalefactor is a "value option". Valid range is 1 through 100. The default is 100.


Input and Output files

These parameters must appear last in the command line.

in-file
The input file, refer to Supported Formats. The default is stdin.

out-file
The output file in a printer specific format. The default is stdout.
-eps
This option is only used if a PostScript printer is selected. It ensures that the output file conforms to the conventions for Encapsulated PostScript.

Environment Options
-printer printer
This specifies the name of the printer. You can also specify the printer by means of the PRINTER variable. The -printer option overrides the PRINTER variable. The default is the printer you most recently have selected in the Printer Selection dialog.

The printer name enables ecprint to retrieve defaults and find the correct printer description file.

-printqueue queuename
You may specify the print queue and the printer description file as an alternative to the -printer option. The print queue must be specified, either directly or through the -printer option (the print queue is given if you specify the -printer option, because the printer name is just shorthand for a combination of a specific print queue and a specific printer description file).
-pd printer-description-file
This is the name of the printer description file (PPD or EPD file) for the printer. The default is generic.ppd.

If you specify the -printer option the printer description file is given, because the printer name is just shorthand for a combination of a specific print queue and a specific printer description file.

-sysdir sysdir
Specifies the path name of the easycopy/system directory, where EPD and PPD files are located. If the -sysdir option is not supplied, the directory pointed to by the SYSDIR variable is used. The -sysdir option overrides the SYSDIR variable. The easycopy/system directory must be available to ecprint; the normal installation procedure sets the correct value of the SYSDIR variable in the ecprint script. If the path name is not available the program terminates with an error message.

-inifile initialization-file
Specifies the path name of the system-wide initialization file. If the -inifile option is not supplied, the file pointed to by the INIFILE variable is used. The -inifile option overrides the INIFILE variable. The system-wide initialization file must be available to ecprint; the normal installation procedure sets the correct value of the INIFILE variable in the ecprint script. If the path name of the system-wide initialization file is not available the program terminates with an error message.

-tmpdir tempdir
Specifies the directory for the temporary files. Normally, you do not need this option; it is intended for test purposes, for example if you occasionally run a print job that requires more temporary space than is available in the default location. If the -tmpdir option is not supplied the value of the TMPDIR variable is used. The normal installation procedure sets the correct value in the ecprint invocation script.

-user login-name
When ecprint is used as a print queue filter this option provides the name of the user who submitted the print job. This enables ecprint to retrieve user defaults. When ecprint is used on the command line, there is no need for this option.

Informational Options
-help
Displays help and usage information about ecprint, refer to example above.

Printer options in the help list refer to the printer given by the -printer option, so if you want to display options for another printer than your default printer you must supply the printer name.

ecprint terminates after it has displayed the help information.

-version
Displays version information, release date, operating system, and the system's primary key (used for registration).

ecprint terminates after it has displayed the version information.

-warning { false | true }
This option controls if warning messages should be issued. Specify -warning true on the command line in troubleshooting situations. Warnings are written to stderror (normally your terminal or console window) if you have invoked ecprint from the command line.

If ecprint is running as part of the spooling process (print queue processing) warning and error messages are written to the error log file that is associated with the print queue.


Page Layout Options
These options are used to specify the position and size of the printed image. Layout options are ignored if the input file is a PostScript file that is passed through to a PostScript printer. The options correspond to the controls available in the Page Layout dialog. Refer to the Page Layout dialog for detailed descriptions.
-orientation { bestfit | portrait | landscape }
Specifies the orientation of the printed output on the page.

-unit { inches | millimeters | dots | points }
Specifies the unit of measurement.

-horizontal { left | center | right }
-vertical { top | center | bottom }
Specifies the alignment of the printed image.

-offset [left] [+top]
Specifies the offset of the printed image from the top left corner of the physical page.

Specify either alignments or offset. If you specify both the last given option counts.

-size [width] [xheight]
Specifies the absolute size of the printed image.

The -size option also implies the aspect ratio.
To produce a print with a width of 4 inches and the height calculated automatically according to the aspect ratio of the input image, type -size 4.
To produce a print with the height of 8 inches and the width calculated automatically with maintained aspect ratio, type -size x8.
Include both the width and the height if you do not want to maintain the aspect ratio.

-scalefactor <0-100>
Specifies the relative size of the printed image in percent (refer also to Page Layout dialog).

-pixscale scale
Specifies a scale factor as number of printer dots per input pixel (refer also to Page Layout dialog).

-metricscale scale
Specifies a metric scale factor. To get a printed images in 1:1 scale specify –metricscale 1. This method is only available if the input file has a known metric size (refer also to Page Layout dialog).

Specify either -size or one of the scale options. If you specify more than one size or scale option only the last one given counts.


Color Options These device independent color options specify color modifications that apply before the image is rendered for printing. Color options are ignored if the input file is a PostScript file that is passed through to a PostScript printer. The options correspond to the controls available in the Color Options dialog. Refer to the Color Options dialog for detailed descriptions.
-output { color | gray | bw }
Specifies the output mode.

-removebgs {none | 1 | 2 | 3 | 4 | 5} Specifies removal of one or more background colors.

-reversal {none | bw | gray | color} Specifies color reversal mode.

-8color {false | true} Specifies reduction to 8 pure colors.

Printer Setup Options
These are printer specific setup options defined in the associated printer description file. They correspond to the controls available in the three tabs of the Printer Setup dialog. Refer to the Printer Setup dialog for detailed descriptions.

The available options, their names, and valid range of values depend on the printer. Use the help list to get a list of the available options for a given printer:

$ ecprint -printer printer-name -help

Many printer setup options appear with the first letter of each "word" capitalized exactly as extracted from the printer description file. You need not type the option exactly as shown. Printer options can be entered in lowercase or abbreviated like other command line options.

The printer options described here are commonly used; however, an option is available for a given printer only if it is defined in the printer description file as a multiple choice; otherwise the option is illegal.


Printer Setup - Paper Options
-PageSize { Letter | Legal | A4 | ... | Custom }
Specifies the page size.
The last entry in the list of page sizes is Custom if the printer supports custom page sizes. The dimensions of the custom page can be specified with the -custompagesize option.

If a page size defined in the printer description file is unavailable due to a license restrictions it appears with an asterisk in the help listing.

-custompagesize [width] [xheight]
Specifies the dimensions of a custom defined page size. This option is available if the printer supports custom page sizes. The unit of measurement is controlled by the -unit option (inches is the default).

The -custompagesize option is acknowledged only if -pagesize custom is also specified.

-MediaType { Paper | Transparency | ... }
Specifies the media type.

-Source {AutoSelect |UpperTray | LowerTray |...| ManualFeed}
Specifies the media tray or input slot to use as the media source.

Printer Setup - Appearance Options
-Resolution { 300x300dpi | 300x600dpi | 600x600dpi |... }
Specifies the printer resolution in dots per inch (dpi).

Many printers only support one resolution setting. However, to ensure that you can always find the resolution information in a consistent way (in the Printer Setup dialog or by means of ecprint -help) the option is always defined.

Normally, the resolution is the same in both directions (isomorphic resoluution). However, many newer printers support anamorphic resolution modes, for example 300x600dpi which means a resolution of 300 dpi horizontally, and 600 dpi vertically.

If all resolution settings for the printer are isomorphic, the printer description file may specify the settings in a shorthand form, for example 300dpi in stead of 300x300dpi. The shorthand form and the complete form cannot be intermixed in a printer description file. If you supply this option unabbreviated you must use the same form as practiced in the printer description file. However, due to the abbreviation rules -res 300 matches an isomorphic resolution of 300 dpi no matter which of the two forms is employed in the printer description file.

-gamma <0.10-9.90>
Specifies the gamma correction.
This is not taken into consideration if gamma correction is inconsistent with possible printer options for color correction.
These options apply only to printers with an active EasyColor profile:
-EasyColor { ColorInks | BlackInk | ... | None }
Specifies the EasyColor color correction profile.

-saturation <0-100>
Specifies the weight of saturation when EasyColor color correction must trade off between correct saturation and correct hue. This is only taken into consideration if also the -EasyColor option is effective.

-ecblue <0-100>
Specifies the adjustment of blue. The default value is 50 (no adjustment). Set a value < 50 to reduce green. Set a value > 50 to reduce purple.

These options do not apply to PostScript printers:
-quality { presentation | draft }
Specifies the print quality; presentation is default.

If this option is present you should not specify -scaling and -shading because an explicit print quality specification implies given printer specific settings of these options.

-ShadingMethod { Scatter | Screening | Dithering | Halftoning | ... }
Specifies the shading method.

-ShadingMatrix { 6x6 | 8x8 | ... }
Some shading methods also use a specific matrix size.

-ScalingMethod { Averaging | Replication | Interpolation | hwn }
Specifies the scaling method. The default is implied by the -quality option.

If you choose a hardware scaling you must also specify hardware shading and vice versa.


Printer Setup - Features
-mirror { false | true }
Specifies mirrored print.

These options refer to PostScript printers:
-encoding { autoselect | ascii }
Specifies the encoding of a PostScript output file.

-lzw { true | false }
Specifies LZW compression of the data stream.

-lzwmode { autoselect | predictor | nopredictor } Specifies the LZW predictor mode.

-jpeg { false | true | <1-20> }
Specifies JPEG compression of the image data stream. You can specify false to disable JPEG compression, true to enable JPEG compression using the default quality, or a number from 1 to 20 to enable JPEG compression and set the quality explicitly.

This options refer to PCL printers:
-compression { packbits | runlength | none }
Specifies the compression of the data stream.


Other Options
-copies <1-999>
This specifies the number of copies. One copy is default. You can specify a maximum of 999 copies.

Response File
-mkres response-file
Specifies the path name of a response file to be made. The response file created with the -mkres option is identical to the response header that ecx creates when a print is requested. The file can be used for subsequent invocations of ecprint, or you can put it in front of the input file to create a print job file. If the specified response file already exists, it is updated.

The generated response file encloses the options between AGICMD and AGICMDEND. The response file does not contain any of the options -printer, -sys, -inifile, -tmp, -user, and -mkres.

@response-file
The response file may contain any number of options, exactly as they are specified on the command line, enclosed between AGICMD ... AGICMDEND. The master-space character @ must precede the name of the response file.

Copyright © 2003, AGI (autoGraph international), www.augrin.com.