-
Notifications
You must be signed in to change notification settings - Fork 128
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
[chrome_print] add support for PDF streaming #205
Conversation
So cool ! Thanks @RLesur ! |
IMO, the next step will be to change the default behavior of |
Would that mean compatibility issues with previous Chrome version and pagedown if we make it the default ? |
The compatibility issue would only be with older versions of Chrome which do not support PDF streaming. But, for now, I think that we could take benefit of Chrome PDF streaming capabilities like this:
IMO, this would lead to a better user experience: |
Oh yeah if we have a way to check this is the way to go. I suggest we open an issue to track the idea of changing this to the default in future versions ? That way, I'll remember to do it in case you don't find the time! |
The aim of this PR is to add support for PDF streaming in
chrome_print()
.For now, very large PDF lead to a websocket error:
The Page.printToPDF method has an experimental feature to return the PDF as a stream:
transferMode = "ReturnAsStream"
.With this PR, one can print a PDF with the stream transfer mode:
TODO
Edit: tested with a 24 MB PDF file (4 stream chunks)
add support for the chunksize
parameter (see IO.read)Edit: after several tests, I think this is useless, the
websocket
package works fine