Fix style of pdf export
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -165,12 +165,16 @@ func (c *Converter) GeneratePDF(ctx context.Context, htmlDocument []byte, cfg Re
|
|||||||
err := chromedp.Run(
|
err := chromedp.Run(
|
||||||
ctx,
|
ctx,
|
||||||
chromedp.Navigate("about:blank"),
|
chromedp.Navigate("about:blank"),
|
||||||
chromedp.ActionFunc(func(ctx context.Context) error {
|
chromedp.ActionFunc(
|
||||||
|
func(ctx context.Context) error {
|
||||||
frameTree, err := page.GetFrameTree().Do(ctx)
|
frameTree, err := page.GetFrameTree().Do(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot get frame tree: %w", err)
|
return fmt.Errorf("cannot get frame tree: %w", err)
|
||||||
}
|
}
|
||||||
return page.SetDocumentContent(frameTree.Frame.ID, htmlContent).Do(ctx)
|
if err := page.SetDocumentContent(frameTree.Frame.ID, htmlContent).Do(ctx); err != nil {
|
||||||
|
return fmt.Errorf("cannot set document content: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}),
|
}),
|
||||||
chromedp.WaitReady("body"),
|
chromedp.WaitReady("body"),
|
||||||
chromedp.ActionFunc(waitUntilDocumentReady),
|
chromedp.ActionFunc(waitUntilDocumentReady),
|
||||||
|
|||||||
Reference in New Issue
Block a user