Printing problems with web pages :: finding a good tutorial for printing web pages (build jquery ui, jqgrid, zend)

I have to print website web pages using jqgrid, jquery calendar + other jquery ui + background images, etc. On the server side, build it with the Zend Framework.

I have no experience and knowledge in printing on web pages, but I get this mission in my work.

I need:

  • Good tutorials or books (I read about the problem of background images) to study this problem well (I have time for this).

  • Additional practical instructions on how to print web pages that are built using jQuery + jQuery UI + jqgrid (I know that the jQuery user interface has browser compatibility issues vs yui (yahoo library)).

Thanks to all the great people who help,

+4
source share
1 answer

Many printing problems can be resolved by considering the media attribute of the style definition. You can declare

 <link rel="stylesheet" type="text/css" media="screen" href="..." /> 

to enable css only for screen only, use media="all" to determine what information will be displayed both on the screen and on the printer or to make html elements displayed only during printing. For example, with the jQuery user interface, you might find a good idea to print only the selected tab (or accordion). You may find it helpful not to print some hidden divs like div.loadingui . So you can make CSS like

 <style type="text/css" media="screen"> #printableButNotVisible { display:none } </style> <style type="text/css" media="print"> #accordion h3, #vcol, div.loadingui, div.ui-tabs-hide, ul.ui-tabs-nav li, td.HeaderRight { display:none } #printableButNotVisible { display:block } </style> 

This is just an example, but I hope to explain the main idea. In addition, you can dynamically create css and embed or switch to your html document (see http://docs.jquery.com/Tutorials//_Quick_jQuery_Tips#Switch_A_Stylesheet ).

It might be a good idea to remove the menu from the page while printing, but I cannot give you any example, because I do not know which menu you are using.

If someone knows good CSS for print media for jQuery UI and for jqGrid, this will be very interesting for me too.

+5
source

Source: https://habr.com/ru/post/1311676/


All Articles