realbasic-nug
[Top] [All Lists]

HTMLViewer: Print a page using javascript

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: HTMLViewer: Print a page using javascript
From: Carlos M <rblists@rbtips.com>
Date: Fri, 29 May 2009 16:22:28 +0100
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=zzLKrhK9Q9nseduQjmTLBvAcfccYzxujCdjl5vPuUlU=; b=AnTq/GKHBoP/GKT2fKPrOPeK/lZubUoglOW+eGeWbba+Uu+skdTOBQD/TTA8BmNMgg Ju1sVW6Bjfss/XOF0cSkO7MppQ+IpGQX/iMijQnpPw7NmZt3DEyp5c2CfVnxj3wpziAl kOt+peD4/gwsbm0Y8FifKwoQ/XeH/avPBFkrI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=raUqeDUqW4xZKkv9UaNe7cVRLvTq8Sivetn/b/XNnBaDPEoBg+4Yh7xkC9GXieQWuI 20EEziEpNe7h/+N8NR2wcdVVFxxOocT+dJsmxVTiiL0KkMMrZMbs6vtNqGo46WqVoJOr HHyvigD62YW9dR5/V1Ho73BgI9WmQ7Yrz7Ia8=
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
For future reference here are some ways using javascript to print a
page with HTMLViewer.

Load a Page:
HTMLViewer1.LoadURL "http://www.example.com";

Print the page using javascript:
(Any of the following works on Windows with an HTMLViewer. Not tested
on MAC, but probably one of the javascript instructions might work)
HTMLViewer1.LoadURL("javascript:void(window.print());")
HTMLViewer1.LoadURL("javascript:window.print();")
HTMLViewer1.LoadURL("javascript:self.print();")
HTMLViewer1.LoadURL("javascript:this.print();")

Note: The browser must have javascript enabled.

Carlos

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>