Data structure describing a print context
See below.
The PpPrintContext_t structure describes a print context. Its members control how printing is to be done.
PpPrintContext_t is an opaque datatype. Use PpGetPC() to extract members, and PpSetPC() to change them. |
The possible values and meanings for the members of a print context are defined in /usr/photon/print/printers.
A print context includes the data described in the sections that follow. Each section indicates the type of data, but see PpGetPC() and PpSetPC() for details.
PpPrintContext_t includes the following members:
Data type: char
The order of pages that are printed in print jobs that are printing more than one copy. The modes may include:
Data type: char
The color mode to use — you might want to print in black and white on a color printer. Possible meanings:
Data type: PpPCControl_t
This member is the control structure for the print context.
You can't use PpSetPC() to set Pp_PC_CONTROL. |
The control structure has at least the following members:
This bit field can be manipulated with the following macros, which are defined in <photon/PpT.h>:
For example:
if( Pp_testbit( control-gt;changed_prop, Pp_PC_NAME) ) printf( "Print name has been changed\n");
if( Pp_testbit( control-gt;emitted_prop, Pp_PC_NAME) ) printf( "source offset has been emitted\n");
Data type: char
The number of copies to produce.
Data type: char[]
The date the print job was started. It's filled in when the print job is initialized. See PpStartJob() and PpContinueJob().
Data type: char[]
Usually the spooler to use (e.g. /dev/spool/Ph.main_deskjet).
If you're sending the print job directly to a printer (such as /dev/par1), set Pp_PC_FILENAME to be the name of the printer (e.g. /dev/par1) and Pp_PC_DRIVER to be the name of the Photon print driver that produces output that the printer recognizes.
If both the device and filename members are set, the output goes to the destination identified by the filename. |
Data type: char
The type of dithering. Possible meanings are defined in the printer configuration file, and include:
Data type: char
If nonzero, the preview application is launched rather submitting the job to a spooler.
Data type: char[]
The print filter, such as phs-to-pcl, to launch if printing to a file (if a filename is specified). For information about the available print drivers, see the entries for the phs-to-* Photon print drivers in the Utilities Reference.
Data type: char
Specifies whether (1) or not (0) to do double-sided printing.
Data type: char[]
If this member is specified, the final output of the print job is placed in this file instead of being sent to a device.
For raw phs output, you need to pass the file through a spooler device. There's a simple phs-to-phs filter (similar to cat) for this purpose.
Data type: char
The type of ink. Possible meanings:
Data type: unsigned long
The printing intensity, expressed as a value between 0% and 100%. A printer's default intensity is 50%.
Data type: char[]
The name of the print job, for identification purposes.
Data type: PhRect_t
A rectangle that specifies the margins to apply to the pages, in 1/1000ths of an inch:
The orientation of the page doesn't affect the margins.
Data type: unsigned long
The maximum size of the temporary phs file, in bytes.
Data type: char[]
The name of the printer (e.g. R&D main printer).
Data type: PhRect_t
A rectangle that specifies (in 1/1000ths of an inch) the nonprintable margins of the printer.
Data type: char
Possible meanings include portrait and landscape, as defined in the printer-configuration file.
Data type: unsigned long
The number of the current page being printed.
Data type: PpPageRange_t
The range of pages to be printed. The application should use this information when producing the printed output; only the requested pages need to be printed.
The page range is a PpPageRange_t structure with two int members, from and to. Special meanings for the range are:
from | to | Print: |
---|---|---|
0 | 0 | All |
-1 | -1 | Selected region |
n | 0 | From page n to the end of the document |
The library assumes that the first page printed is the first requested page. If this isn't the case, use Pp_PC_PAGE_NUM to set the page number manually.
Data type: PhDim_t
The dimensions of the paper, including margins and the nonprintable area, in 1/1000ths of an inch. This size is used for clipping and for any scaling that may be applied.
Data type: char
The paper source, for printers that support more than one paper tray. The possible meanings are:
Data type: char
The type of paper. This is in the range 0 through 100. Possible meanings include:
Data type: char[]
The application to launch to preview the print job, usually /usr/photon/bin/preview.
Data type: PhDim_t
The printing mode, specified in x and y dots per inch. The printer tries to print at this resolution.
Data type: char[]
The application to launch to adjust the printer properties portion of the print context.
Data type: char
If this is nonzero, the pages are printed in reverse order. The default is forward.
Data type: PhPoint_t
The scale to use in x and y:
If the x and y scales are both 0, the source is scaled to be as large as possible to fit on the page and still maintain its x and y aspect ratio. |
Data type: unsigned long
The number of bitplanes per source pixel. If this is n, you'll have 2n colors. For example, a value of 8 means 256 colors. This is a hint that helps the print drivers improve the dithering model. The default is 24bpp (True Color).
Data type: PhPoint_t
The origin for the print job. For example, if a widget you want to print is at (50,50) but you want it to appear in the upper left corner of the page, set the source offset to (50,50).
This offset affects the entire page; to affect an individual widget, use the trans argument to PpPrintWidget().
Data type: PhDim_t
The resolution, in pixels per inch, of the original source image. This is a hint that helps the print drivers do the best scaling possible. The default is 100 pixels per inch.
Data type: PhDim_t
The dimension of the source image, in pixels. This size is used for clipping and for any scaling that may be applied.
Data type: char[]
The user creating the print job. This member is filled in when the print job is initialized. See PpStartJob() and PpContinueJob().
Photon
PpContinueJob(), PpGetPC(), PpPrintWidget(), PpSetPC(), PpStartJob()
For information about the available print drivers, see the entries for the phs-to-* Photon print drivers in the Utilities Reference.