How to send data to the printer
1 answer
First, you might want to use a print style sheet. This will allow you to hide certain things from your layout when users print your pages, such as navigation, search box, footer, etc.
Second, you can use jQuery to subtly insert a "Print this page" javascript link that will be activated by the browser's "Print" dialog on the user's screen upon activation.
- JavaScript Unobtrusive Print Link (with jQuery) | Trevor Davis
- Progressive extension with jQuery "MakeMineATriple
Since this is a client-side thing, there is no real CakePHP solution for this problem. The only thing you can do is disable or change the layout used in the controller like this:
-
$this->layout = false;
-
$this->layout = 'print';
+4
source to share