Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide custom onLoadingStart and onLoadingEnd hooks #99

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

steveklebanoff
Copy link
Contributor

See #98

@crabbly crabbly merged commit 57e5f35 into crabbly:master Dec 1, 2017
@steveklebanoff
Copy link
Contributor Author

@crabbly can you let me know when this is published to npm? 😄

@crabbly
Copy link
Owner

crabbly commented Dec 1, 2017

@steveklebanoff Done! :)

@steveklebanoff
Copy link
Contributor Author

@crabbly Awesome. Is http://printjs.crabbly.com/ open source? Would be good to update the Configuration

@crabbly
Copy link
Owner

crabbly commented Dec 1, 2017

Yes it is. The same repository, under the gh-pages branch.

@9585999
Copy link

9585999 commented Apr 11, 2018

these hooks work fine when the file type is pdf, if I want to show a preloader when I get data type html, then the modal window does not work properly, although it was not superfluous, because when using targetStyles: ["*"] is present a significant delay of 1-2 seconds before the appearance of the print window ...

@crabbly
Copy link
Owner

crabbly commented Apr 14, 2018

Hey @9585999 , the loading modal was initially intended to be used with PDF loading, but it does apply for any printing type. However, we may have to apply a promise in html.js to proceed only after all html elements styles were processed.

The problem with targetStyles: ["*"] may be related to either with large / complex html or slow machines. This feature was intended to print small parts / sections of html. Processing every style applied to each element is not the best solution. I'm working on another solution for html printing, which will not require all this style processing with javascript. This will also support CSS media queries, which is a great plus.

In the meantime, adding a promise to html.js would be nice. I will try to get to it if I can. A PR would be very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants