How to take printout by button of php webpage

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
ankit.pandeyc012
Forum Newbie
Posts: 8
Joined: Sun Nov 14, 2010 11:25 pm

How to take printout by button of php webpage

Post by ankit.pandeyc012 »

[text]Hi 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...................... [/text]
bestwebdesigner
Forum Newbie
Posts: 9
Joined: Mon Jan 31, 2011 4:38 am

Re: How to take printout by button of php webpage

Post by bestwebdesigner »

Hi,
You can use this java script coding for taking print out.

Code: Select all

function winPrint(){
document.getElementById("pButton").style.display = "none";
window.print();
}
...
<button id="pButton" onclick="winPrint()" />
...

Post Reply