Using CSS and/or jQuery for Printed Pages with Page Breaks

前端 未结 5 1393
灰色年华
灰色年华 2020-12-31 17:50

I have a dynamically generated html page which is designed to be printed.

I would like to create page breaks based upon div sections - where any given div - if it DO

5条回答
  •  忘掉有多难
    2020-12-31 18:38

    You could try using this plugin to print the elements of a page. http://www.recoding.it/wp-content/uploads/demos/jqprint-demo.htm

    This could be helpful if you follow the same logic you suggested for a desktop application. You can wrap your "pages" in divs and that's what you would tell jqPrint to print. The page breaks could be another element or also a div but with a class to let you know it's page break. For example:

    ...

etc..

then

$('#page1').jqprint(); 

I don't know if you're familiar with jQuery. If you're not let us know.

提交回复
热议问题