Promotic
WikipediaLinkedInYoutubeTwitterFacebook

PrintHtmlPage - method of object Pm

Description:
Print or display the preview of the HTML page or text.
Syntax:
PrintHtmlPage(sHtml As String, sOptions As String)
Calling:
Pm.PrintHtmlPage sHtml, sOption
Parameters:
sHtml(String) Name and path to the file or the source content of the HTML page (according to the sourcetype).
sOptions(String) A text list of additional parameters. Entries with assigned value are separated by a semicolon, for example "sourcetype:url;printer:select;".
"sourcetype:xxx;" (mandatory) - Defines 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. I.e. in this case it is not a HTML text, but ordinary unformated text (for example in *.txt file).
file - In sHtml, there is the path to a file on the disc. See PROMOTIC path to files and folders.
url - In sHtml, there is the URL address. It is passed to Internet Explorerwith no modification. It should contain also the prefix (http://, file:// ..)
"printer:xxx;" (optional) - Defining the printer.
select (default) - Printing with the option of selecting the printer and changing the setting (orientation, resolution, etc.) by using the input window.
default - Printing with the OS Windows default printer (no input window). The default printer settings cannot be modified (orientation, resolution, etc.).
preview - Displaying the print preview with the option of changing the setting (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:
The method can also be called in the graphic item events for Web Panels. I.e. 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 for printer:select; setting)
Example1:
Printing the content of an url adress with the option to choose and configure the printer.
Pm.PrintHtmlPage "http://www.promotic.eu", "sourcetype:url;printer:select;"
Example2:
Printing a text file.
Pm.PrintHtmlPage "#app:Log.txt", "sourcetype:file;printer:default;"
Example3:
Printing image file.
Pm.PrintHtmlPage "#appres:Image.png", "sourcetype:file;printer:default;"
Example4:
Printing the content of text variable
Dim sString
sString = Pm.FileTextRead("#data:file.txt", 0)
Pm.PrintHtmlPage sString, "sourcetype:textstring;printer:default;"
Example5:
Preview before printing the PmReport object
Dim oReport
Set oReport = pMe.Pm("/Reports/Report1)
Pm.PrintHtmlPage oReport.SaveToString(""), "sourcetype:htmlstring;printer:preview;"
Example6:
Printing from the variable filled with the ActiveX TrendsView print page on the default OS Windows printer with the option to set the dimensions of the page.
Dim sHtml
sHtml="string:"
oTView.SaveToHtm "", sHtml, "mode:graph;"
Pm.PrintHtmlPage sHtml, "sourcetype:htmlstring;printer:default;width:2100;height:2970;"
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- PrintHtmlPage
 
 
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice