简体   繁体   中英

How can i control the number of pages to be print using javascript?

I want to control the pages that is to be print by following options: 1. Print All Pages 2. Print Current Page 3. Print selected pages (like 3,4,6-9 etc)

By using window.print() all the pages gets selected by default. How can i pass the required pages for printing, so that window.print() have those pages only. I need to use JavaScript for this purpose.

Hi I made an some code sample based on my comment https://jsfiddle.net/hg9cn7hs/

in this example div with class second-page will be ignored in print, you need to add just the custom logic for your scenario.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM