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

Q: How to get perfect snapshot of WKWebview content #6

Open
codebeauty opened this issue Jul 28, 2021 · 1 comment
Open

Q: How to get perfect snapshot of WKWebview content #6

codebeauty opened this issue Jul 28, 2021 · 1 comment

Comments

@codebeauty
Copy link

I try to generate a perfect snapshot of the content of a WebView. The content is bigger than the screen and I get the size of the content handover by JS into the iOS app.

The following image shows a blue UIImageView with the snapshot. The green part is the body of HTML, fixed by setting width and height in JS the same width and height is handover into the app to set the WebView to the same size.

snap

The challenge is that I get a whitespace on the right and the bottom inside the snapshot. The whitespace is from the HTML content (tested by setting background-color in css).

I tried different methods of SnapshotKit for the WebView including scrollView. Any idea what I miss? How I can prevent the whitespace and clip it to a given size by JS?

@YK-Unit
Copy link
Owner

YK-Unit commented Jul 29, 2021

This is a known issue, and unfortunately, there is no good solution yet. Maybe you can try to detect the bottom white content and cut off it.

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

No branches or pull requests

2 participants