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

add ScreenshotScale that allows specifying page scale factor #1354

Merged
merged 1 commit into from Aug 19, 2023

Conversation

ZekeLu
Copy link
Member

@ZekeLu ZekeLu commented Aug 16, 2023

After the change, there will be four functions for taking screenshot:

func Screenshot(sel interface{}, picbuf *[]byte, opts ...QueryOption) QueryAction
func ScreenshotScale(sel interface{}, scale float64, picbuf *[]byte, opts ...QueryOption) QueryAction
func CaptureScreenshot(res *[]byte) Action
func FullScreenshot(res *[]byte, quality int) EmulateAction

It's a little mess, I hope that we can come up with a better API to unify them all.

Fixes #1191.

@mrueg
Copy link

mrueg commented Aug 16, 2023

Thanks a lot for creating this change! It will definitely be helpful for https://github.com/kovetskiy/mark :)

@ZekeLu ZekeLu merged commit d11f130 into chromedp:master Aug 19, 2023
3 checks passed
@ZekeLu ZekeLu deleted the screenshot-scale branch September 12, 2023 03:47
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.

How does chromdp scale html or svg files for screenshots
2 participants