yandoo Posted April 14, 2008 Share Posted April 14, 2008 Hi there, I was hoping for some help with my php project please... I need to create a button that will print an area of my web page (middle of page showing records). I this possible??? I so how please??? Could somebody point me indirect of script or tutorial please?? Kind Regards Link to comment https://forums.phpfreaks.com/topic/101064-print-area-button/ Share on other sites More sharing options...
GingerRobot Posted April 14, 2008 Share Posted April 14, 2008 Printing a page is a job for javascript. Weather or not you can have javascript print a portion of the page i'm not sure. Im not aware of a way, but then im no expert. Perhaps you will need to have the button launch a page containing the information you want printed and print from there. Link to comment https://forums.phpfreaks.com/topic/101064-print-area-button/#findComment-516790 Share on other sites More sharing options...
poleposters Posted April 14, 2008 Share Posted April 14, 2008 As far as I know you'll need to create a link or button that says print.This will open up a seperate window which only displays the information you want printed. In a print friendly format ie paper size. To create this page all you need to do is reuse the part of the script that displays only the information you want to print. Then its simply a matter of displaying a print submit button using javascript use this code echo '<a href="javascript:window.print()">print</a>'; There might be a more elegant way to do this without opening a second browser window. But i'm unaware of this. Check out a javascript forum for more info. Although the above is the simplest way it is usually done. Link to comment https://forums.phpfreaks.com/topic/101064-print-area-button/#findComment-516925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.