| United States-English |
|
|
|
![]() |
HP-UX Starbase Device Drivers Manual - Vol2: HP 9000 Series 700 Computers > Chapter 3 Printer Command Language FormatterUsing the Graphics Print Procedures |
|
The Starbase Graphics Techniques chapter "Storing, Retrieving, and Printing Images" should be read prior to reading this section. Briefly, the graphics print procedures are:
The user controls the output using parameters of the bitmap_print and file_print procedures and parameters in the configuration file. Except for the formatter and config parameters, all other parameters are discussed in the Starbase Graphics Techniques manual. The print procedures require specification of two parameters which are unique to the PCL formatter:
The program bmprint.c can be found in\Footnote The actual path names of directories in angle brackets depend on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{}:
You may desire to customize it for your application environment or to make multiple copies under different names that reference different configuration files. Essentially this program executes the gopen call on a bitmap without initializing it, allowing all or a portion of the currently displayed bitmap to be printed. Run time parameters allow you to specify:
You should make a copy of the source, modify it as required to reflect the configuration file and defaults you desire to use, and then compile and link it as described in the section of this chapter concerning linking. The background (-k) option affects the resulting print in one of two ways depending upon whether a single plane is being printed or not. If a single plane is being printed and no background is selected, the foreground and background index parameters are active and specify what is to be printed (foreground) and not printed (background). In all other cases (not single plane), the actual background color index used by the formatter (the index whose printing will be suppressed) is obtained from one of two sources. In the case of a non-single plane being printed from a bitmap opened with the gopen, the formatter uses the current Starbase background index. In the case of a non-single plane being printed from a Starbase bitmap file the background index is obtained from the Starbase bitmap file being printed. A final note on background indexes. If you decide to set the Starbase background color index prior to a bitmap_print operation and the color map's shade mode is CMAP_FULL with more than eight planes the resulting index is a 24-bit value. The upper eight bits are used for red, the center eight bits are used for blue, and the lower eight bits are used for green. You may want to use background_color rather then background_color_index providing the specific (float) red, green, and blue values rather than computing the 24-bit index.
When using direct access printing, the first parameter of the configuration file (output goes to std out parameter) should be set to FALSE. The special device file parameter of the configuration file should be set to the special device file of the printer (see the section on setting up the special device file). You must have write permission for the device file. The following examples assume that a bitmap has been created containing the data you desire to print. In the case of bitmap_print, dcbitmap_print, and intbitmap_print calls fildes is the file descriptor of the bitmap opened with gopen. In the case of file_print, myfile.dat is the Starbase bitmap file previously created. The configuration file is config.prtr.
Access to a non-spooled printer requires an HP-UX environment (in order to use the ">" and "|" redirection and pipe symbols). The following examples use a configuration file named config.temp which has the output to a file named temp. The example special device file is 〈dev〉[21]/rlp. The previously prepared Starbase bitmap file is myfile.dat. The HP-UX environment can be obtained from within a program using the HP-UX Reference, Section 3 procedure system. Similar functionality may be obtained by invoking the HP-UX Reference, Section 1 procedure pcltrans, or by running the provided bmprint program.
Spooling can be done using the HP-UX command pcltrans. Spooling may also be done utilizing the file_print, dcbitmap_print, bitmap_print, and intbitmap_print procedures in conjunction with the HP-UX procedure system. Using the system procedure, you can spool a file from within a program. A possible sequence within a program might be to create a file using the bitmap_to_file procedure and then use the system procedure to invoke the spooler. Alternatively, a program might invoke bitmap_print with a configuration file specified that directs output to standard out in a system procedure call which also pipes the output to lp in raw mode. The following examples are given as possible ways to spool raster graphics data from Starbase bitmaps. You should review the pertinent sections of the Starbase Reference manual for the correct calling parameters (parms). Note that the following programming examples are written in C.
The default print orientation is analogous to landscape mode on a LaserJet or LaserJet Plus printer. That is, width is across the long paper dimension, and height is across the narrow paper dimension. Print rows that extend beyond the last column on the physical page will generally be clipped by the printer. However, this action is printer dependent. Print columns that extend beyond the last row on the physical page will be printed onto the next (fanfold) page. This formatter determines the target page size based on information in the configuration file. Specifically, page_length, page_width, and resolution determine the number of dots in the output page. The cell_size parameter is used to determine the number of input pixels that will fit on the output page as follows:
Prints will be truncated according to the target page size by the formatter. The following example may help clarify this.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||