boo_lolly Posted December 14, 2007 Share Posted December 14, 2007 first, is this best attempted using php or javascript? i'm sure there are many approaches. you could turn it into a pdf document and have them download it manually. or a .doc file sent to their desktop. or a simple click of the link will activate the default printer. what's the best approach? any advice? Link to comment https://forums.phpfreaks.com/topic/81624-solved-php-and-printer-friendly-viewprint-functions/ Share on other sites More sharing options...
trq Posted December 14, 2007 Share Posted December 14, 2007 Printing is client-side, php, server-side. Link to comment https://forums.phpfreaks.com/topic/81624-solved-php-and-printer-friendly-viewprint-functions/#findComment-414641 Share on other sites More sharing options...
cooldude832 Posted December 14, 2007 Share Posted December 14, 2007 you might be able to do something like this: Person loads your document you have a butotn on it that says print This! it goes to printhis.php?page=page1.php then the printhtis.php takes the $_GET['page']; and runs file_get_contents on that path, returns the outputted xhtml,css and then using a ton of stuff formats it into a pdf and then the user can take that pdf to go. If you are looking for a general solution its gonna be rough, if you have a constant temaplate you might have an easier go. Link to comment https://forums.phpfreaks.com/topic/81624-solved-php-and-printer-friendly-viewprint-functions/#findComment-414643 Share on other sites More sharing options...
boo_lolly Posted December 14, 2007 Author Share Posted December 14, 2007 i just ended up creating a pdf of the document and added a direct link to the file. Link to comment https://forums.phpfreaks.com/topic/81624-solved-php-and-printer-friendly-viewprint-functions/#findComment-414653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.