Closed dotqi closed 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
}
Duplicate of https://github.com/chromedp/chromedp/issues/625. Please don't file issues twice.
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
}
}