user1595077
user1595077

Reputation: 131

Printing multiple pages in JQuery

I'm trying to print (via a printer) two or more div's, each to its own page. I'm trying out different plugins, including printArea. I've tried something along the lines of :

this.$el.find(".print").map(function () {
  $(this).printArea();
});

in Chrome it brings up the print dialog twice, once for each div, but in Firefox, it just prints the last div. (Granted, I'm printing to a file instead of via a printer...) Showing the dialog twice is acceptable, though it would be nice to break it into two pages beforehand. And also - how would I get this working in Firefox?

Thanks!

Upvotes: 0

Views: 4970

Answers (1)

Christian
Christian

Reputation: 19740

Instead of trying fancy plugins, why not use a page break?

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

Upvotes: 2

Related Questions