Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Print - method of object PmiRoot

Description:
Printing the open panel (or its part) to a printer or to the file.
Syntax:
Print(sOptions As String)
Calling:
oRoot.Print("")
Parameters:
sOptions(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.
Note:
The method can also be called in the graphic item events for Web Panels. So far the sOptions parameter is not functional for web (the printing also does not work).
Example1:
Printing the whole panel. Printing from the onButtonUp event from button (PmiButton) in this 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.Root.Print ""
Example2:
Printing the cutout of the panel, where the cutout begins on the position 100,100 and its size is 300,200. Printing from the onButtonUp event from button (PmiButton) in this 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.Root.Print "x:100;y:100;dx:300;dy:200;"
Example3:
Printing the whole panel into file #temp:panel.png;. Printing from the onButtonUp event from button (PmiButton) in this panel. The resulting size of the image is determined by the size of the panel or the selected portion.
pMe.Root.Print "printer:file:#temp:panel.png;"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice