add three event callbacks#148
Conversation
* beforePrintEvent: callback function printEvent in iframe * beforePrint: null: callback function will be triggered before iframe created * afterPrint: null: callback function will be triggered before iframe removed i use beforePrint and afterPrint to make my canvas an image - in my case, chartjs in bootstrap col
|
Thanks for the pull request. This is very similar to pull request #54 and you can read my reasoning as to why I did not merge that code. Here's my reasoning (quoting my comment from #54):
Because these events are not true events (such as an actual complete event from the browser), I have concerns over actual timing, performance, and behavior of these actions because they depend on the code executing sequentially, which is fairly arbitrary. @oculus42 - any opinion/feedback here? |
|
It's quite similar but mine using callback function as a hook instead of event trigger. So, I think this pull will execute the hooks in correct sequence. ps. i tested in chrome, will test more in firefox and safari |
|
It has been my experience that Firefox has not always been reliable about the timing of the print events and the state of the page. I am working on some tests to execute against a variety of different platforms. |
oculus42
left a comment
There was a problem hiding this comment.
I haven't competed the test suite, and I would like to get to a point where we can identify the behavior of the supported browsers, but I think this would be a good addition.
i use
beforePrintto make my canvas an image - in my case, chartjs in bootstrap with div class="col"then
afterPrintfor removing images created