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 determining if the panel is printed
0 (default) - by new method
1 - by old method
sOptions[optional] (String) Text list of parameters that define the way of printing (crop, etc.). If not stated, 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 with assigned value are separated by a semicolon, 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 - Name of the file (*.bmp, *.png, *.jpg, *.gif or *.tif) with path, where the panel or its portion will be saved. The file extension determines 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 valuue 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 opened, the panel is opened invisibly and it is closed after printing. Whilst the onOpen and onClose events are not fired.
 
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.
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.
pMe.Pm("/panel").Print0, "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.
pMe.Root.Print 0, "printer:file:#temp:panel.png;"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice