Open albert-ying opened 2 years ago
I just tested. Same code works fine for a smaller HTML slides. Maybe it is due to the slide is too big and took a while to process, which is longer than the timed out
limit and been killed? If so how do I adjust for the timed out
limit?
Interesting problem, I haven't run into this before. Is there an html slide deck that you could link to so we could try and reproduce this error?
Not sure whether it is related, but I adjusted the size of some figures in the slides, now I don't see the error. I just opened a new issue #44 which might related to this
The image size is likely the root cause of the problem -- I'd be interested to hear how large the image was before you reduced the size.
This does bring up that both pagedown::chrome_print()
and chromote
allow us to configure the timeout when waiting for the page load and we could expose this cleanly in build_pdf()
.
We'd add the wait
arg to chrome_print()
here (the default is 2
) https://github.com/jhelvy/xaringanBuilder/blob/235c8c41d9e720fa48171fa8567839d2e042660d/R/pdf.R#L99-L102
And <ChromoteSession>$Page$loadEventFired()
has a timeout_
argument (not sure what the specific default value is there), which we'd want to set here https://github.com/jhelvy/xaringanBuilder/blob/235c8c41d9e720fa48171fa8567839d2e042660d/R/pdf.R#L123-L124
I used to have ~30 pictures, each ~ 5Mb. I also noticed that sometimes by setting self-contain: true
, the timeout error could be avoided. Probably because it take a long time to load pictures. It would be nice to be able to set the timeout limit as an argument from build_*
functions in the future! Thank you so much!
Ah that makes sense. 150MB of images isn't gigantic but it is fairly large. Check out the issue and linked Twitter thread in #26, there are some tips there about reducing the image size without losing quality!
Hi, when building to pdf from HTML, I got these errors
And sometimes
I'm wondering what may cause this and how may I prevent it?
Thank you!