PlzzzzzzzzHi friends..............
I have a page in which all details of user displays. I want that when user click on button"Print ICard" then ICard is printed and this printed Icard have size of what I desire instead of full page and I also need "Thank You" message on print out which is not displayed in web page....
I don't have much knowledge of css and php. So, please give the full code of it.............
Plzzzzzzzzz help............
Anyone????????????
thanks in advance......................
I want to take printout with a button of php output
Moderator: General Moderators
-
ankit.pandeyc012
- Forum Newbie
- Posts: 8
- Joined: Sun Nov 14, 2010 11:25 pm
I want to take printout with a button of php output
-
rahulzatakia
- Forum Commoner
- Posts: 59
- Joined: Fri Feb 05, 2010 12:01 am
- Location: Ahmedabad
Re: I want to take printout with a button of php output
Hi, use the following code to print the current page
<script Language="Javascript">
function printit(){
if (window.print) {
window.print();
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</script>
<script Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
}
</script>
<script Language="Javascript">
function printit(){
if (window.print) {
window.print();
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</script>
<script Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
}
</script>