Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 223
alyson_216 Avatar asked Oct 18 '22 19:10

alyson_216


1 Answers

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.

like image 81
Grissom Avatar answered Oct 31 '22 15:10

Grissom