Update cookies preferences
Promotic

PrintHtmlPage - method of the Pm object

Description:
Print or display the preview of the HTML page or text.
Syntax:
Empty PrintHtmlPage(String sHtml, String sOptions)
Parameters:
sHtml(String) Specifies HTML page (or source of text, image, etc.).
It is possible to enter variously (according to setting of sourcetype):
- URL address, see Example1.
- The file name with the path, see Example2 and Example3.
- The source content of the HTML page, see Example5 and Example6.
- Text content, see Example4.
sOptions(String) Additional parameters Entries are in the KeyVal format, for example "sourcetype:url;printer:select;".
"sourcetype:xxx;" (mandatory) - Specifies the meaning of the sHtml parameter
htmlstring - In sHtml, there is the content of the HTML page.
textstring - In sHtml, there is the content of the TXT page. It means that in this case it is not a HTML text, but ordinary unformated text (for example in the *.txt file).
file - In sHtml, there is the path to the file on the disk. See PROMOTIC path to files or folders.
url - In sHtml, there is the URL address. It is passed to InternetExplorer unchanged. It should contain also the prefix (http://, file:// ...)
"printer:xxx;" (optional) - Specifies the printer for printing.
select (default) - Print with the option of selecting the printer and changing the settings (orientation, resolution, etc.) using the input window.
default - Printing with the Windows OS default printer (no input window). The default printer settings cannot be modified (orientation, resolution, etc.).
preview - Displays the print preview with the option of changing the settings (orientation, resolution, etc.).
"width:xxx;" (optional) - The width of the source page before printing. The width and height are usually optional because the content adapts to the printed page.
"height:xxx;" (optional) - The height of the source page before printing.
Note:
This method is also functional in Web panels. It means that it is possible to print also in Web client, with following limitations:
- sourcetype:file; is not functional
- printer:default; is not functional (the query for printer is always carried out, the same way as on setting printer:select;)
Example1:
Print the content at URL with the possibility to choose and configure the printer.
JavaScriptVBScriptSelect and copy to clipboard

Pm.PrintHtmlPage("https://www.promotic.eu", "sourcetype:url;printer:select;");
Example2:
Print a text file.
JavaScriptVBScriptSelect and copy to clipboard

Pm.PrintHtmlPage("#app:Log.txt", "sourcetype:file;printer:default;");
Example3:
Print image file.
JavaScriptVBScriptSelect and copy to clipboard

Pm.PrintHtmlPage("#appres:Image.png", "sourcetype:file;printer:default;");
Example4:
Print the content of text variable
VBScriptSelect and copy to clipboard

Dim sString
sString = Pm.FileTextRead("#data:file.txt", 0)
Pm.PrintHtmlPage sString, "sourcetype:file;printer:default;"
Example5:
Preview before printing the PmaReport object
VBScriptSelect and copy to clipboard

Dim oReport
Set oReport = pMe.Pm("/Reports/Report1")
Pm.PrintHtmlPage oReport.SaveToString(""), "sourcetype:htmlstring;printer:preview;"
Example6:
Printing from the variable filled with the PmgTrendViewer object print page on the default Windows OS printer with the option to set the dimensions of the page.
JavaScriptVBScriptSelect and copy to clipboard

var sHtml = oTView.SaveToHtm("ver:1", "return:", "mode:graph;");
Pm.PrintHtmlPage(sHtml, "sourcetype:htmlstring;printer:preview;width:700px;height:930px;");

History:
Pm8.00.10: Print now works also in modes "select" (printer selection) and "preview" (print preview).
Pm8.00.07: Fixed bug: The preview was sometimes displayed outside the visible desktop.
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- PrintHtmlPage
 
 
- Sin
- Tan
© MICROSYS, spol. s r.o.