edabg / jsprintsetup

JSPrintSetup Firefox addon
Mozilla Public License 2.0
77 stars 39 forks source link

How to split pages and print pages all. #40

Closed tangwz closed 7 years ago

tangwz commented 7 years ago

I don't understand if I set printRange to kRangeAllPages and then the printer will print what. What is all pages? How can I set pages. If I want to print similar pages one times. How can I set option and print all? I'm really confused.

mitkola commented 7 years ago

kRangeAllPages - print all pages kRangeSpecifiedPageRange – print specified pages (see startPageRange and endPageRange) kRangeSelection – Prints selection kRangeFocusFrame – print focused frame

if you want to print from some page to other page, for example from page 2 to 3 you do this:

jsPrintSetup.setOption('printRange', jsPrintSetup.kRangeSpecifiedPageRange);
jsPrintSetup.setOption('startPageRange ', 2);
jsPrintSetup.setOption('endPageRange', 3);
tangwz commented 7 years ago

@mitkola thanks. But what is page mean in HTML?<body></body>?

mitkola commented 7 years ago

The pages are created due process of print rendering depending on media.

tangwz commented 7 years ago

Did this mean that the pages I just can use when I print a file, I cannot use it in HTML? Sorry I can't find any demo use it in HTML. I just want to print multi webpages one time like print pages.

I try to use

@media print {
    .print {page-break-after: always;}
 }

then I see the div which class="print" was split to two page. I think this is your mean media.

Thank you, I will continue to try.