jasonday / printThis

jQuery printing plugin; print specific elements on a page

Home Page:https://jasonday.github.io/printThis/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event when the print frame has already been created but the print window is not yet open

KuJIT1 opened this issue · comments

There is no way to edit the print frame before the print window opens. There are several elements on the page fragment that I want to send to print. I want to remove some elements and print the remaining ones on separate pages using 'page-break-after': 'always'. Thus, the size of the print area will change (in particular due to page breaks).

When you run BeforePrint, the print frame does not yet exist. When executing beforePrintHandler, the page sizes are already calculated, and in my case, these sizes are incorrect due to the page-break

I think the best thing to do is to either be more specific with your selectors for the things you want to include in the print, or use an @media print to hide elements you don't want printed.