Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Print - method of object PmPanel

Description:
Printing the panel (or its part) o a printer or to the file.
Syntax:
Print([nAttr As Long], [sOptions As String], [sParams As String]) As Boolean
Calling:
oPanel.Print
Parameters:
nAttr[optional] (Long) Parameter specifies if the panel is printed
0 (default) - by new method
1 - by old method
sOptions[optional] (String) Additional parameters that define the way of printing (crop, etc.). If not set, then the whole panel is printed with default settings. The value of the sOptions parameter is taken also from the static default object setting, see sOptions default value. Entries are in format KeyVal, for example "x:0;y:0;dx:300;dy:200;printer:select;printzoom:0;".
"x:nn;" (optional) - x-position of the left upper point of the cutout (in pixels, default 0).
"y:nn;" (optional) - y-position of the left upper point of the cutout (in pixels, default 0).
"dx:nn;" (optional) - x-size of the crop (in pixels, default 0 = the whole panel).
"dy:nn;" (optional) - y-size of the crop (in pixels, default 0 = the whole panel).
"printer:xx;" (optional) - Allows to choose and configure the printer.
select (default) - The system dialog will be displayed for printer setup.
default - The print will be executed on default OS Windows printer.
pmprinter_path - The (absolute) path to the PmPrinter object, that contains the information about the selected printer (e.g. "printer:/printer0;").
file:filepath - The file name with the path (*.bmp, *.png, *.jpg, *.gif or *.tif), where the panel or its portion will be saved. The file extension specifies the graphic format. It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders. The resulting size of the image is determined by the size of the panel or the selected portion.
"printzoom:nn;" (optional) - The resulting size of the image is determined by the size of the panel or the selected portion.
sParams[optional] (String) Allows to set the value of parameters of PmiRoot graphic item. This parameter is then accessible in the panel configurators by the Macro expression $.par and from the script by the GetPar method. Each parameter consists of an identifier (name) and a value. Syntax: "par:name1=value1;par:name2=value2; ...". See also: Parameters of graphic item. The value of the sParams parameter is taken from the default static object setting. See sParams default value.
Note:
If the method is called over the panel that is not open then the panel is opened invisibly and then it is closed after printing is finished. During this process the onOpen and onClose events are not activated.
 
This method is not functional for Web panels. it is better to use the PmiRoot.Print method.
Example1:
Printing the whole panel. The panel will be stretched to the size of the paper (aspect ratio kept) and printer selection and setup dialog will be displayed.
VBScriptSelect and copy to clipboard

Dim b
b = pMe.Pm("/panel").Print()
Example2:
Printing the cutout of the panel, where the cutout begins on the position 100,100 and its size is 300,200. The panel will be stretched to the size of the paper (aspect ratio kept) and printer selection and setup dialog will be displayed.
VBScriptSelect and copy to clipboard

Dim b
b = pMe.Pm("/panel").Print(0, "x:100;y:100;dx:300;dy:200;")
Example3:
Printing the whole panel into file #temp:panel.png;. The resulting size of the image is determined by the size of the panel or the selected portion.
VBScriptSelect and copy to clipboard

Dim b
b = pMe.Pm("/panel").Print(0, "printer:file:#temp:panel.png;")
PROMOTIC 8.3.26 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice