WebHTMLViewer.Print

From Xojo Documentation

Method

WebHTMLViewer.Print()

New in 2012r1

Supported for all project types and targets.

Prints the contents of the WebHTMLViewer (or web page with some browsers).

Notes

Firefox and Internet Explorer print the contents of the entire web page, not just the WebHTMLViewer.

The contents will not print if the domain and port of the WebPage do not match the domain and port of the WebHTMLViewer contents. This means content from other web sites cannot be printed.

Example

This example first loads some HTML into the viewer in the Open event. A WebButton then calls the Print method. Print displays the Print dialog for the platform on which the client is running and then prints the content.

This code is in the Open event of the WebHTMLViewer:

Me.LoadPage("<html><body><h1>This is a test</h1></body></html>")


This code is in the Action event of a WebButton:

HTMLViewer1.Print