sOptions | (String) Additional parameters that define the way of printing (crop, etc.).
If not set, then the whole panel is printed with default settting. The value of the sOptions parameter is taken also from the static default object setting, see sFramePars default value. Entries are in the KeyVal format, for example "x:0;y:0;dx:300;dy:200;printer:select;printzoom:0;". "x:nn;" (optional) - x-position of the left upper corner of the cutout (in pixels, default 0).
"y:nn;" (optional) - y-position of the left upper corner of the cutout (in pixels, default 0).
"dx:nn;" (optional) - Size of the x-crop (in pixels, default 0 = the whole panel).
"dy:nn;" (optional) - Size of the y-crop (in pixels, default 0 = the whole panel).
"printer:xx;" (optional) - It allows to select and configure the printer.
select (default) - The system window will be displayed for printer setup.
default - Print will be executed on default Windows OS printer.
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 in the file is determined by the size of the panel or the selected portion. "printzoom:nn;" (optional) - The resulting size of the image in the file is determined by the size of the panel or the selected portion. |
---|
pMe.Root.Print("");
pMe.Root.Print("x:100;y:100;dx:300;dy:200;");
pMe.Root.Print("printer:file:#temp:Img/panel.png;");
var oCreator = Pm.CreateView(pMe.Pm("/Workspace"), "/PanelTrend", "pars:{parPrint:yes;}", "target:blank;");
oCreator.Open();
if (pMe.Root.GetPar("parPrint") == "yes")
{
function OnPrint()
{
pMe.Root.Print("printer:default;");
pMe.Root.AddEventTimer(2000, 1, pMe.GetPathName(), OnClose);
}
function OnClose()
{
pMe.Root.Close("");
}
pMe.Root.AddEventTimer(2000, 1, pMe.GetPathName(), OnPrint);
}