-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Webpage screenshots #70
Comments
Thanks for the idea. I am pinging @tensor-programming because he has been working on how to rig Tauri for testing purposes, and the domain seems similar. |
It might be worthwhile to look into how tools like cypress and webdriver.io do screencaptures. |
I've created an example using html2canvas to capture webpages as png, but it doesn't work for all sites (probably origin issues as you suggested on discord): https://github.com/sciguy16/wry-screenshot |
So, taking this one step further, could we use something like this to send that PNG to a PDF (and kill two flies with one swat): This uses printpdf under the hood: https://github.com/Quantaly/jpeg-to-pdf/blob/main/Cargo.toml |
The problem with that is it would only have the content shown in the viewport, not the whole page, right?. |
Look what I just found (thanks @lucasfernog )
|
Please see #236 - this resolves for ALL platforms and creates proper PDF. |
Is your feature request related to a problem? Please describe.
I think it would be useful to be able to capture screenshots of the rendered document/webpage, for example to programmatically screenshot web servers of as part of automated testing.
Stretch goal: potentially build a viable replacement for phantomjs, but that's probably not in scope for this issue.
Describe the solution you'd like
Ideally, some way to read the rendered framebuffer into a Vec of pixels so that it can be processed/encoded as PNG/etc.
Describe alternatives you've considered
In theory it should be possible to achieve this by injecting a copy of html2canvas into the page and then somehow getting the captured image back out of the webview, but some method for directly reading the rendered page would be cleaner (and more performant).
Would you assign yourself to implement this feature?
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: