chromedp / cdproto

Package cdproto contains the generated commands, types, and events for the Chrome DevTools Protocol domains.
MIT License
147 stars 54 forks source link

Invalid withlandscape #8

Closed dotqi closed 4 years ago

dotqi commented 4 years ago

When generating PDF using chromedp.

It takes effect when using withlandscape to generate horizontal PDF. The generated PDF is still vertical.

code:

err := chromedp.Run(ctx, chromedp.Tasks{

chromedp.Navigate(url),

chromedp.WaitReady("body"),

chromedp.ActionFunc(func(ctx context.Context) error {

var err error

p := page.PrintToPDF().WithLandscape(true)

buf, _, err = p.Do(ctx)

return err

}

}

mvdan commented 4 years ago

Duplicate of https://github.com/chromedp/chromedp/issues/625. Please don't file issues twice.