I’m doing a project in codeginiter these days, i want to print just the text area when the print button is clicked? can you guys help me to achieve this?
regards.
Rangana
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
codeigniter is an excellent framework, but unfortunately doesn’t quite apply in this case because php is a server side scripting language and printing is done clientside. For printing a given area you’ll want to use some javascript, specifying the div you want to print out. I would recommend the jQuery library as it has a print plugin I’ve used in a few of my projects. So you would use php to define code like this
Which would then execute client side when the print button is pressed.
Check out jquery here http://jquery.com/
There’s also the vanilla window.print() function with setting up a print stylesheet if you don’t want to use jQuery.