Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Print this Page
System
Is there anyway we can offer users to 'Print this Page' from a generated TPL?
Find more posts tagged with
Comments
Michael
Assuming the your output is HTML then the following JavaScript should do the trick.
============================================================
Script: Print Current Window From A Link
Function: Opens printer dialogue to print current page
Browsers: Version 4 and later (others degrade gracefully)
Author: etLux
============================================================
Step 1.
Put the following script in the head of your page.
<script>
// (C) 2000
www.CodeLifter.com
//
http://www.codelifter.com
// Free for all users, but leave in this header
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
</script>
============================================================
Step 2.
Put the following in the body of your page.
<a href="javascript:printWindow()">Print This Page</a>
============================================================