CPC View provides inline viewing capabilities for images in a variety of formats including TIFF, CALS, JEDMICS, JFAX, and CPC. The viewer supports multi-page document navigation, scaling, rotation, anti-aliased images, thumbnails, annotations, and much more. Consult the CPC View User's Guide for a complete description of the viewer's capabilities and user interface.
CPC View is packaged in a number of variants (e.g., browser plugin; ActiveX control). Regardless of the specific package, CPC View exposes a common programming and event interface allowing complete programmable control of the viewer by external applications. This document describes the common programmable interface to CPC View.
The current version of the browser plugin does not yet support programmable control.
Within a parameter list, each parameter is described by a string of the form name=value, where name is the parameter name and value is the parameter value (similar to the URL parameters). The =value portion of the parameter may be omitted, in which case the value is taken to be the empty string. Multiple parameters are separated with a semi-colon (;) and the entire parameter list may optionally be terminated with a semi-colon.
For example, the string foo=123;wingbat;bar=this is a message describes a parameter list containing three parameters, foo, wingbat, and bar. The value of foo is the string, 123, the value of wingbat is the empty string, and the value of bar is the string, this is a message.
Colors may also be encoded by name. The following color names are defined. (Color names are case insensitive.)
Name | Description | |
---|---|---|
WHITE | V5.2 | White as defined by the current desktop color scheme |
LIGHTGRAY | V5.2 | Light gray as defined by the current desktop color scheme |
DARKGRAY | V5.2 | Dark gray as defined by the current desktop color scheme |
BLACK | V5.2 | Black as defined by the current desktop color scheme |
OFFWHITE | V5.2 | A color midway between WHITE and LIGHTGRAY |
WINDOWBG | V5.2 | The application background color as defined by the current desktop color scheme |
The color names are only used when setting parameter values. CPC View will always return color values in the RRGGBB format.
function paramGet(plist, name) { |
Space Name | Related To | Type | As Of |
---|---|---|---|
Annotation | Programmable annotations | write only | V5.2 |
Cmd | User interface commands | write only | V5.8.5 |
Document | Current document | read only | V5.2 |
Page | Current page | read only | V5.2 |
UI | User interface settings | read write | V5.2 |
Version | Software version information | read only | V5.2 |
The state of a parameter space is the value of all of the space's parameters. CPC View provides three methods for manipulating the state of parameter spaces. The getState method retrieves the state of a parameter space and the setState and setStateS methods modify the state of a parameter space.
CPC View Method: getState |
Prototype: String getState(String spaceName) |
Returns: A parameter list describing the current state of the parameter space named spaceName. |
Not all parameter spaces support this method. Some spaces (e.g., Annotation space) are write-only and hence support only the setState and setStateS methods. |
CPC View Method: setState |
Prototype: BOOL setState(String spaceName, String plist) |
Modifies the state of the parameter space whose name is spaceName. The modifications are specified in the parameter list plist. Only those parameters explicitly referenced by plist are modified. All other parameters within the space remain unchanged. |
Returns: Non-zero if spaceName was a recognized parameter space. Otherwise, returns zero. |
The return value does not indicate whether or not all of the parameters in the list were successfully updated. Unrecognized parameters are simply ignored. |
Not all parameter spaces support this method. Some spaces (e.g., Document space) are read-only and hence support only the getState method. |
CPC View Method: setStateS |
Prototype: String setStateS(String spaceName, String plist) |
Modifies the state of the parameter space whose name is spaceName. The modifications are specified in the parameter list plist. Only those parameters explicitly referenced by plist are modified. All other parameters within the space remain unchanged. |
Returns: A parameter list describing the result of the operation. The parameter
worked will be set to 1 if the operation worked. If the operation fails,
the parameter err will be set to a string describing the error. If the operation was cancelled
by the user, the parameter usercancel will be set to 1.
Other parameters that are specific to the parameter space may also be included in the returned parameter list. These parameters are described in the documentation for the specific parameter space. |
Not all parameter spaces support this method. Some spaces (e.g., Document space) are read-only and hence support only the getState method. |
This method requires version 6.5.6 or later of the viewer. |
A subspace name is constructed by appending a parameter list to the space name, separated by a colon. The parameter list specifies whatever additional parameters are used to address subspaces within the specific parameter space. The particular parameters used to address a subspace are defined by the controlling parameter space. For example, the name foo:id=123 would refer to the subspace whose id is 123 within the mythical FOO parameter space.
If a parameter space supports subspaces, the subspace name is used as the spaceName argument to the getState and setState method calls.
The DOCUMENT space parameters are not available until the document has been opened. CPC View opens documents asynchronously in the background, and hence, the document is opened sometime after the viewer is loaded. CPC View sends the DOCOPEN event after the document is opened.
DOCUMENT PARAMETER: format=name[ENUMERATION] |
name specifies the document's underlying file format. Possible values are cpc, tiff, cals, pbm, or c4. |
If omitted by getState: CPC View has not yet opened the document. |
Example: format=tiff The document is in TIFF format. |
DOCUMENT PARAMETER: numPages=n[INTEGER] |
n is the number of pages in the current document. |
If omitted by getState: The number of pages in the document has not yet been determined. |
Example: numPages=3 The document has three pages. |
INVOCATION: getState("Document") |
RESULT: numPages=2;format=cpc
The current document has 2 pages and is in CPC format. |
PAGE PARAMETER: dim=width[INTEGER],height[INTEGER] |
The dimensions of the selected page in pixels. width is the number of pixels in one row of the image and height is the number of pixel rows in the image. The height and width are separated by a comma. |
If omitted by getState: The dimensions of the page are not yet known. |
Example: dim=1200,1888 The current page is 1200 pixels wide and 1888 pixels high. |
PAGE PARAMETER: dpi=xres[INTEGER],yres[INTEGER] |
The resolution of the current page in dots per inch. xres is the horizontal resolution and yres is the vertical resolution. The horizontal and vertical resolutions are separated by a comma. |
If omitted by getState: The resolution of the page is not known. |
Example: dpi=204,96 The current page has a horizontal resolution of 204 dpi and a vertical resolution of 96 dpi. |
PAGE PARAMETER: numAnnotations=n[INTEGER] |
n is the number of annotations on the current page. Programmable annotations are not included in the count. |
If omitted by getState: There are no annotations on the current page (or there is no current page because the document is not yet loaded). |
Example: numAnnotations=1 The current page contains 1 annotation. |
INVOCATION: getState("Page") |
RESULT: dim=1280,1500;dpi=300,300;numAnnotations=2
The currently selected page is 1280 pixels wide and 1500 pixels high. The image has a resolution of 300 dpi. The page contains 2 annotations. |
UI PARAMETER: thumbnail=cols[INTEGER],rows[INTEGER] |
The current view mode. If set, the viewer is in thumbnail view. To set page mode, use !thumbnail. |
Width and height are used to determine the layout of the thumbnails
(Width and height are optional. If they are not specified when setting
thumbnail mode, the most recent thumbnail layout is restored.)
|
If omitted by getState: The viewer is in page mode. |
Example: !thumbnail Put the viewer in page mode. |
Example: thumbnail Put the viewer in thumbnail mode. |
Example: thumbnail=3,0 Put the viewer in thumbnail mode and layout the thumbnails three to a row. |
UI PARAMETER: page=n[INTEGER] |
n is the page number of the currently selected page. Pages are numbered from one. |
Example: page=3 Select the third page of the document. |
The base display page affects the display of page numbers to the user. It does not alter the page numbering used by the parameters of the UI space. The statement page=1 always specifies the first page of the document.
UI PARAMETER: baseDisplayPage=n[INTEGER] |
n is the page number to display for the first page in the document. |
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. |
Example: baseDisplayPage=123 The first page of the document is displayed to the user as page 123. |
UI PARAMETER: rotation=r[ENUMERATION] |
The current rotation is r which must be either 0, 90, 180, or 360. The rotation is measured clockwise and applies to every page of the document. |
UI PARAMETER: position=x[CUSTOM],y[CUSTOM] |
The position within the image of the upper left hand corner of the display window
is specified by the two coordinates x and y.
Each of the coordinates can be specified as either:
|
getState Notes: The position coordinates will always use FLOAT values. |
UI PARAMETER: scale=spec[CUSTOM] |
Specifies the magnification of the image. spec must be one of the following:
|
getState Notes: The value of scale will be set to the fitwidth or fitheight value if either of these modes is active. Otherwise, the value will be set to the absolute scale factor (val[FLOAT]). |
UI PARAMETER: scalevalue=val[FLOAT] |
Specifies the actual magnification of the image, when the value of scale is either fitwidth or fitheight. |
READ ONLY: This parameter is read-only. Its value can not be modified by setState. |
Requires CPC View v6.4 or later. |
The image reduction algorithm used by the viewer is optimized for integral reductions of the image. When reducing the image, the viewer may round the reduction up to improve rendering speed and image appearance. This adjustment can be disabled to allow for slightly better use of screen space when fitting the image to the window and greater accuracy when zooming with the mouse. The enablement of this adjustment is available though the preciseZoom parameter of UI space. Changes to the value of preciseZoom (via setState) will take effect on the next change in the scale.
UI PARAMETER: preciseZoom [BOOLEAN] |
If TRUE, the reduction algorithm scales images exactly. Otherwise, the reduction algorithm adjusts the scale to optimize performance. To disable exact scaling, use !preciseZoom. |
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. |
UI PARAMETER: toolbar=pos[ENUMERATION] | ||||||||||||||||||
The position of the toolbar. pos must be one of the following:
| ||||||||||||||||||
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. | ||||||||||||||||||
Example: !toolbar Hide the toolbar. | ||||||||||||||||||
Example: toolbar=bottom The toolbar is placed along the bottom edge of the window. |
The viewer has several different controls that can be placed on the toolbar. The current set of controls is available though the controls parameter of UI space. Changes to the value of controls (via setState) will be reflected in the user interface immediately.
UI PARAMETER: controls=spec[CUSTOM] | ||||||||||||||||||||||||||||||
Spec is a list of
the controls that should appear on the toolbar. Each control name may be preceded
by an exclamation mark (!) to specify removal of the control from the toolbar. The
following control names are recognized:
| ||||||||||||||||||||||||||||||
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. | ||||||||||||||||||||||||||||||
Example: controls=all,!scrollpad Enables all the controls except for the scroll pad control. | ||||||||||||||||||||||||||||||
Example: controls=page+scrollpad+zoom+status The tool bar contains (in order) the page, scrollpad, zoom and status controls. |
The foreground and background colors are not used when displaying
color images.
The current foreground color is available though the foregroundColor parameter of UI space. Changes to the value of foregroundColor (via setState) will be reflected in the user interface immediately.
UI PARAMETER: foregroundColor=c[COLOR] |
The foreground color is c. This parameter has no effect on color images. |
The current background color is available though the backgroundColor parameter of UI space. Changes to the value of backgroundColor (via setState) will be reflected in the user interface immediately.
UI PARAMETER: backgroundColor=c[COLOR] |
The background color is c. This parameter has no effect on color images. |
UI PARAMETER: mouseMode=mode[ENUMERATION] | ||||||||||||
The mouse mode. Mode must be one of the following:
|
UI PARAMETER: docTitle=s[STRING] |
The title of the document to display in the status tool. If no title is specified, a title is derived from the document's URL. |
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. |
Only the most recently visited URLs are maintained. There is no guarantee that on return to a URL, the document parameters will be restored.
In some instances, it is desirable to override the document parameters. In this way, the application can be certain that the UI is restored to a particular setting. This can be accomplished via the strict parameter of the UI space.
UI PARAMETER: strict [BOOLEAN] |
If set, the document parameters for the current document are not used. Additionally, any changes made to the UI by the user will not be saved in the user's document preferences. |
WRITE ONLY: This parameter is write-only. Its value is not returned by getState. |
VERSION PARAMETER: rev=major[INTEGER],minor[INTEGER],respin[INTEGER] |
The revision level of the installed version of CPC View. The revision level is specified as a triplet of integers separated by commas. The first number (major) is the major revision level. The second number (minor) is the minor revision level (within the specified major revision). The third number (respin) is the respin number (within the specified minor revision). |
Example: rev=5,2,1 The currently installed revision of CPC View is 5.2.1. That is, the major revision is 5, the minor revision is 2, and the respin number is 1. |
VERSION PARAMETER: variant=val[ENUMERATION] |
Specifies the variant of CPC View that is installed. Currently, this is the string ActiveX Control. |
VERSION PARAMETER: buildNum=n[INTEGER] |
Each build of CPC View is given a unique build number. n is the build number of the current version. |
VERSION PARAMETER: buildTime=t[INTEGER] |
The time at which this version was built. The time (t) is expressed as the number of seconds since January 1, 1970. |
INVOCATION: getState("Version") |
RESULT: buildNum=123;buildTime=12345678;rev=5,2,1;variant=ActiveX Control
This is revision 5.2.1 of CPC View. The build number for the revision is 123. The revision was built 12345678 seconds after January 1, 1970. |
Virtually all of the annotation functionality available in the CPC View user interface is also available programmatically. (The only user interface functionality that is not available programmatically is the popup sound functionality.) Annotations created and manipulated under programmable control, known as programmable annotations, are distinct from any annotations created by the user via the CPC View user interface, known as user annotations. This means that:
The ANNOTATION space is a write-only space. It does not support the getState method. The state of each programmable annotation is completely specified by the controlling application, so there should not be a need to retrieve the state of an annotation.
Each annotation exists in its own subspace. The page and id parameters of the subspace parameter list are used to specify the page number and ID of the annotation. The page number is one based. That is, the first page of the document is page 1. If page is not specified, the currently selected page is used. For example, the string Annotation:id=123 refers to the annotation on the currently selected page whose id is 123. The string Annotation:id=321;page=1 refers to the annotation on page one whose id is 321.
An annotation is created the first time it is referred to by a setState method invocation. The value of the ID has no semantic meaning other than as a means of identification. The external program is free to use whatever values are most convenient.
ANNOTATION SUBSPACE PARAMETER: id=n[INTEGER] |
The ID of the annotation (n). This parameter identifies the particular annotation that the setState method call applies to. If the named annotation does not exist, it is created with default properties. |
Default: 0 |
ANNOTATION SUBSPACE PARAMETER: page=n[INTEGER] |
The page number on which the annotation resides (n). Pages are numbered from one. If n is zero, the currently selected page of the document is used. |
Default: 0 |
Unlike other parameters, the class parameter is only used on the call that creates the annotation. Subsequent specifications for the class parameter are ignored. There is no way to change the class of an existing annotation.
ANNOTATION PARAMETER: class=className[ENUMERATION] | ||||||||||||||||||
Specifies the class of the annotation. className must be one of the
following names:
| ||||||||||||||||||
Default: Box |
Although most of the parameters in ANNOTATION space are shared by all annotation classes, certain ANNOTATION space parameters are specific to the class. For example, the TEXT annotation supports a drawText parameter describing the text message to display.
ANNOTATION PARAMETER: paperRect=left[INTEGER],top[INTEGER],width[INTEGER],height[INTEGER] |
Specifies the origin and size of the paper rectangle in absolute image pixels. The paper is positioned such that its left edge is at column left and the top edge is at row top. The paper is width pixels wide and height pixels high. If the width or height of the paper rectangle is zero, the paper occupies no space on the page and hence the annotation is invisible. As a convenient shorthand, the specification !paperRect is equivalent to the specification paperRect=0,0,0,0. |
Default: 0,0,0,0 |
ANNOTATION PARAMETER: paperColor=color[COLOR] |
This parameter specifies the color of the annotation paper (color). Prior to drawing, the paper rectangle is filled with this color. |
The paper can also be uncolored. With uncolored paper, only the foreground portions of the annotation are drawn. To specify uncolored paper, use !paperColor. |
Default: FFFFA0 The default value is overridden by some annotation classes. |
ANNOTATION PARAMETER: paperBorder=name[ENUMERATION] | |||||||||||||||
The paper can be embossed with a border. name specifies the name
of the border style and can be one of the following:
| |||||||||||||||
The paper can also have no border. To specify no border, use !paperBorder. | |||||||||||||||
Default: !paperBorder The default value is overridden by some annotation classes. |
ANNOTATION PARAMETER: paperTransparent [BOOLEAN] |
The paper can be opaque or transparent. Any drawing which occurs on transparent paper is composited with the underlying image. Any drawing which occurs on opaque paper obscures the underlying image. If paperTransparent is TRUE, the paper is transparent. To make the paper opaque, use !paperTransparent. |
Default: !paperTransparent The default value is overridden by some annotation classes. |
ANNOTATION PARAMETER: actionUrl=url[STRING] |
Specifies a hyperlink for the annotation. When the user pushes the hyperlink, the URL url will be loaded into the browser. To clear the hyperlink, specify !actionUrl. |
If the URL consists solely of URL parameters (i.e., it begins with a leading # or ?), the parameters are applied to the current document. For example, if url is ?page=1, pushing the hyperlink will cause the viewer to return to page 1 of the current document. |
Default: !actionUrl |
ANNOTATION PARAMETER: actionText=msg[STRING] |
Specifies a popup text message for the annotation. When the user presses the mouse over the annotation, msg will be displayed in a popup window. To clear the popup text, specify !actionText. |
Default: !actionText |
ANNOTATION PARAMETER: actionTip=msg[STRING] |
Specifies a status line tip for the annotation. Whenever the mouse is over the annotation, msg will be displayed in the browser's status line. To clear the tip, specify !actionTip. |
Default: !actionTip |
ANNOTATION PARAMETER: actionIcons [BOOLEAN] |
As with user annotations, a programmable annotation with actions can automatically display icons indicating the nature of the actions (i.e., popup text; hyperlink). The display of icons is controlled by this parameter. If actionIcons is TRUE, icons are displayed indicating the nature of the actions. To remove the icons, use !actionIcons. |
Default: actionIcons |
OVAL ANNOTATION PARAMETER: drawColor=color[COLOR] |
color specifies the color of the interior of the oval. |
Default: FFA0A0 |
OVAL ANNOTATION PARAMETER: edgeColor=color[COLOR] |
A one pixel edge is drawn around the oval. color specifies the color of the edge. |
Default: 000000 (pure black) |
LINE ANNOTATION PARAMETER: drawColor=color[COLOR] |
color specifies the color of the line. |
Default: C00000 |
LINE ANNOTATION PARAMETER: drawSize=n[INTEGER] |
n specifies the pixel thickness of the line at full scale. (The thickness of the line is automatically scaled with the image.) |
Default: 4 |
LINE ANNOTATION PARAMETER: lineType=type[ENUMERATION] | ||||||||||||||||||
The lineType determines the edge points of the annotation paper through
which the line is drawn. type must be one of the following values:
| ||||||||||||||||||
Default: DIAGNW |
LINE ANNOTATION PARAMETER: startArrow [BOOLEAN] |
If set, an arrow is drawn over the starting point of the line. To clear the arrow, specify !startArrow. |
Default: !startArrow |
LINE ANNOTATION PARAMETER: endArrow [BOOLEAN] |
If set, an arrow is drawn over the ending point of the line. To clear the arrow, specify !endArrow. |
Default: !endArrow |
The class overrides the following general parameter defaults:
The following class-specific parameters control the appearance of the freehand line.
FREEHANDLINE ANNOTATION PARAMETER: drawColor=color[COLOR] |
color specifies the color of the line. |
Default: 0000FF |
FREEHANDLINE ANNOTATION PARAMETER: drawSize=n[INTEGER] |
n specifies the pixel thickness of the line at full scale. (The thickness of the line is automatically scaled with the image.) |
Default: 1 |
FREEHANDLINE ANNOTATION PARAMETER: points=point-list[CUSTOM] |
Specifies the list of points to connect. Each point is specified as a coordinate pair, (x y), where x is the column offset (in pixels) of the point from the left edge of the annotation paper and y is the row offset (in pixels) of the point from the top edge of the annotation paper. The coordinate pairs are separated by commas. |
Example: The string (1 1), (3 1), (1 5) specifies a line consisting of two segments. The first segment is from column 1 and row 1 of the annotation paper to column 3 and row 1. The second segment is from column 3 and row 1 to column 1 and row 5. |
The following class-specific parameters allow control of the text font, color, and alignment.
TEXT ANNOTATION PARAMETER: drawHAlign=type[ENUMERATION] | ||||||||||||
Specifies the horizontal alignment of the text within the paper rectangle.
type must be one of the following:
| ||||||||||||
Default: Left |
TEXT ANNOTATION PARAMETER: drawColor=color[COLOR] |
color specifies the color of the text. |
Default: FF0000 |
TEXT ANNOTATION PARAMETER: drawText=msg[STRING] |
msg specifies the text to display. To clear the string, specify !drawText. |
Default: !drawText |
TEXT ANNOTATION PARAMETER: fontSize=n[INTEGER] |
n specifies the point size of the text at full scale. The font size is automatically scaled with the image. |
Default: 36 |
TEXT ANNOTATION PARAMETER: fontFace=name[STRING] |
name specifies the name of the font to use to display the text. |
Default: The system variable width font as specified in the desktop settings. |
The available fonts will differ from computer to computer. If the specified font face is not available, a default font will be used instead. No attempt is made to match the default font to the style of the specified font. |
TEXT ANNOTATION PARAMETER: paperAutoSize [BOOLEAN] |
If set, the font is automatically resized such that the message fits within the scaled paper rectangle. Otherwise, the font is merely scaled to match the current display setting; the message may not fit within the scaled paper rectangle. |
Default: paperAutoSize |
CMD SUBSPACE PARAMETER: op=which[ENUMERATION] | |||||||||
The specific command to invoke. which must be one of the following:
| |||||||||
For brevity, the OP= portion of the subspace name may be omitted. That is, you may write the subspace name as CMD:PRINT or CMD:SAVEAS. |
To provide a level of security against misuse of the feature, CPC View requires that the value of the AutoExec parameter be a valid security permit. A security permit is simply an arbitrary string which is checked against a list of allowable security permits maintained in the Windows registry. If the permit is in the allowed list, the operation proceeds without user interaction; otherwise, the AutoExec parameter is ignored and the operation proceeds exactly as if the AutoExec parameter was not specified.
The list of allowed security permits is maintained in the sub-keys of the following registry key:
The name of each sub-key that exists within this key is an allowable security permit.
For example, if the permit foo123bar is an allowable security permit, the following key must exist in the Windows registry:
CPC View does not create allowable security permits in the registry. The registry's list of allowable security permits must be configured via external means. For example, if the host application has an installation program, the installation program could create the necessary keys.
Unless otherwise noted below, unspecified parameters are initialized to the default values for the current user; that is, the default values will be identical to the default values when the user invokes the print command directly via the user interface.
Prior to version 6.2, plist was not used by this subspace. All parameters were simply initialized to their default values.
CMD:PRINT PARAMETER: AutoScale=type[ENUMERATION] | ||||||||||||
Specifies the mode of scaling to use when printing the images.
type must be one of the following:
| ||||||||||||
Example: autoScale=MatchPrinterResolution Scale each image to match the printer resolution. |
CMD:PRINT PARAMETER: MatchPrinterResolution:DefaultRes=res[INTEGER] |
The default page resolution to use when MatchPrinterResolution is specified. The default page resolution is used when the source image does not specify a resolution. |
Example: matchPrinterResolution:DefaultRes=400 Use a resolution of 400 dpi for any image that does not specify a resolution. |
CMD:PRINT PARAMETER: MatchPrinterResolution:Scale=scale[FLOAT] |
Additional scaling to apply when MatchPrinterResolution is specified. The additional scaling is applied after calculating the scale necessary to match the page image resolution to the printer resolution. |
Example: matchPrinterResolution:Scale=.5 Print the images at 1/2 the calculated size. |
CMD:PRINT PARAMETER: PageRange=range[CUSTOM] | ||||||||||||
Specifies the range of pages to print. range must be one of the following:
| ||||||||||||
Default: All | ||||||||||||
Example: pageRange=1,5,7-9,12- Prints pages 1, 5, 7, 8, 9, and 12 through the last page of the document. |
CMD:PRINT PARAMETER: IncludePages=which[ENUMERATION] | ||||||||||||
Specifies the types of pages to include in the print job.
which must be one of the following:
| ||||||||||||
Default: All | ||||||||||||
Example: includePages=Odd Include only the odd pages that are in pageRange. |
CMD:PRINT PARAMETER: NumCopies=copies[INTEGER] |
Specifies the number of copies to print. |
Default: 1 |
Example: numCopies=3 Print 3 copies of each page. |
CMD:PRINT PARAMETER: Collate [BOOLEAN] |
If TRUE and multiple copies are specified, the copies are collated. |
CMD:PRINT PARAMETER: PrinterName=printer[STRING] |
The name of the printer to use. printer should be specified exactly as it is displayed in the printer dropdown menu of the Select print options dialog box. |
Example: printerName=HP LaserJet 4V Send the images to the printer whose name is HP LaserJet 4V. |
CMD:PRINT PARAMETER: PrintToFile [BOOLEAN] |
If TRUE, printer output is saved in a file rather than sent to the printer. |
Default: FALSE |
CMD:PRINT PARAMETER: OutputFileName=path[STRING] |
The full pathname of the file in which to save the printer output. Specifying this parameter implies PrintToFile. |
The specified file must NOT exist. If the file already exists, the user will be asked whether or not to overwrite the existing file. This prompt will occur even if the AutoExec parameter is specified. |
CMD:PRINT PARAMETER: IncludePageTitles [BOOLEAN] |
If TRUE, the viewer adds page titles to the top of each page. Otherwise, it does not add page titles. |
CMD:PRINT PARAMETER: IncludeAnnotations [BOOLEAN] |
If TRUE, the viewer includes any annotations in the printout. Otherwise, annotations are not included. |
CMD:PRINT PARAMETER: AutomaticOrientation [BOOLEAN] |
If TRUE, the viewer will automatically select landscape or portrait orientation based on the dimensions of each page. Otherwise, the viewer uses the printer's default orientation. |
CMD:PRINT PARAMETER: QuickPrint [BOOLEAN] |
If TRUE, the viewer cuts the resolution of the images in half prior to printing. Otherwise, the images are printed at full resolution. |
CMD:PRINT PARAMETER: InvertImageColors [BOOLEAN] |
If TRUE, the colors of the image are inverted prior to printing. That is, black pixels print as white and white pixels print as black. |
INVOCATION: setState("cmd:print", "") |
RESULT: Invokes the Document/Print... command, exactly as if the user had invoked it from the right mouse menu. |
INVOCATION: setState("cmd:print", "pagerange=1-2;AutoExec=mypermit") |
RESULT: Print pages 1-2 of the current document without any additional user interaction. |
Unspecified parameters are initialized to the default values for the current user; that is, the default values will be identical to the default values when the user invokes the save command directly via the user interface.
Prior to version 6.2, plist was not used by this subspace. All parameters were simply initialized to their default values.
CMD:PRINT PARAMETER: FileName=path[STRING] |
The full pathname of the file in which to save the document. |
Example: filename=c:\temp\foo.cpc Save the document to the file c:\temp\foo.cpc. |
The specified file must NOT exist. If the file already exists, the user will be asked whether or not to overwrite the existing file. This prompt will occur even if the AutoExec parameter is specified. |
CMD:PRINT PARAMETER: FileType=type[ENUM] | ||||||||||||||||||||||||||||||||||||
Specifies the file format in which to save the document. type must be one of the following:
| ||||||||||||||||||||||||||||||||||||
Example: filetype=cpc:annBurn Burn any annotations into the images and save the resultant images in the CPC file format. |
CMD:PRINT PARAMETER: PageRange=range[STRING] |
The pages within the document to save. The page range is specified as a comma-separated list of sub-ranges. Each sub-range is specified as either a single page (e.g., 5) or a contiguous range of pages (e.g., 3-7). Pages are numbered from 1. |
The end page of a contiguous range can be left empty. This is interpreted as a range that ends with the last page of the document. For example, the range 3- specifies all pages from the 3rd page on. |
Example: pagerange=1,5,7-9,12- Saves pages 1, 5, 7, 8, 9, and 12 through the last page of the document. |
INVOCATION: setState("cmd:saveas", "") |
RESULT: Invokes the Document/Save As... command, exactly as if the user had invoked it from the right mouse menu. |
INVOCATION: setState("cmd:saveas", "filename=c:/temp/foo.cpc;pagerange=1-2;AutoExec=mypermit") |
RESULT: Save pages 1-2 of the current document to the file c:/temp/foo.cpc without any additional user interaction. |
For example, the string SimpleEvent describes a fictional SIMPLEEVENT event with no parameters. The string FakeEvent:x=1;y=2 describes a fictional FAKEEVENT event with two additional event parameters: x whose value is 1; and y whose value is 2.
The following event types are defined:
Name | Description | |
---|---|---|
DOCOPEN | V5.2 | The document has been opened |
VIEWCHANGE | V5.2 | The display of the document has changed |
MOUSEMOVE | V5.2 | The mouse cursor was moved within the viewer window |
MOUSEBUTTON | V5.2 | A mouse button was pressed or released within the viewer window |
MOUSEEXIT | V5.2 | The mouse cursor was moved from inside the viewer window to outside the viewer window |
KEYPRESS | V5.2 | The user typed a key on the keyboard |
For example, when the user presses the right mouse button, the internal CPC View handling would normally cause a context menu to pop up. In order to prevent the context menu from appearing, the event handler should return a non-zero value when called with the description of a right mouse button press event.
The DOCOPEN, VIEWCHANGE, MOUSEMOVE, and MOUSEEXIT events do not use the return value of the event handler. There is no additional internal processing for these events.
There are no parameters associated with this event. The return value of the event handler is not used.
CPC View asynchronously loads the image data for the document. Hence, there is some delay between the instantiation of the control and the opening of the document.
There are no parameters associated with this event. The return value of the event handler is not used.
Changes to the scroll position only generate VIEWCHANGE events in CPC View v6.4 or later. Earlier versions of the viewer did not generate VIEWCHANGE events when the scroll position changes.
MOUSEMOVE EVENT PARAMETER: x=col[INTEGER] |
Specifies the absolute column of the image pixel that the mouse is over (col). |
MOUSEMOVE EVENT PARAMETER: y=row[INTEGER] |
Specifies the absolute row of the image pixel that the mouse is over (row). |
MouseMove:x=123;y=456 |
---|
The mouse has moved over the pixel at column 123 and row 456 in the image |
MOUSEBUTTON EVENT PARAMETER: button=which[ENUMERATION] | |||||||||
The button that was pressed or released. which will be one of the
following:
| |||||||||
The middle mouse button does not generate MOUSEBUTTON events. |
MOUSEBUTTON EVENT PARAMETER: state=which[ENUMERATION] | |||||||||
The current state of the button. which will be one of the
following values:
|
MOUSEBUTTON EVENT PARAMETER: x=col[INTEGER] |
x specifies the absolute column of the pixel in the image which the mouse is over. |
MOUSEBUTTON EVENT PARAMETER: y=row[INTEGER] |
y specifies the absolute row of the pixel in the image which the mouse is over. |
MouseButton:x=123;y=456;button=left;state=down |
---|
The left mouse button was pressed over the pixel at column 123 and row 456 in the image |
MouseButton:x=123;y=456;button=left;state=up |
---|
The left mouse button was released over the pixel at column 123 and row 456 in the image |
There are no parameters associated with this event. The return value from the event handler is not used.
CPC View does not provide any visual indication that it has input focus.
KEYPRESS EVENT PARAMETER: char=c[INTEGER] |
The ASCII value of the character that was typed (c). |
KEYPRESS EVENT PARAMETER: ctrl [BOOLEAN] |
The CTRL key was pressed simultaneously. |
If omitted from the parameter list: The CTRL key was not pressed simultaneously |
KEYPRESS EVENT PARAMETER: alt [BOOLEAN] |
The ALT key was pressed simultaneously. |
If omitted from the parameter list: The ALT key was not pressed simultaneously |
KEYPRESS EVENT PARAMETER: shift [BOOLEAN] |
The SHIFT key was pressed simultaneously. |
If omitted from the parameter list: The SHIFT key was not pressed simultaneously |
KeyPress:char=67;ctrl |
---|
The CTRL-C key was pressed. That is, the C and CTRL keys were simultaneously pressed. |
|
|