Customize window.print () in drupal block

I used a block to add an option to print the page. Block content <a onclick='window.print();' style='cursor:pointer'>Print this page</a>

It works great, but I need to customize the content to print. How can this be done?

+3


source to share


2 answers


You can customize what is printed and what the printed content looks like using custom CSS:



<style type="text/css" media="print">
h1 { text-align: center }
</style>

      

+2


source


Unfortunately, you cannot customize window.print (). It will print the focus window. If you need to customize the print area, then the items to be printed should be added in a separate window.



For more information visit here

0


source







All Articles