Fix style of pdf export

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-02-25 16:14:31 +01:00
parent ff62eb4a80
commit a150c91ae7

View File

@@ -165,13 +165,17 @@ 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(
frameTree, err := page.GetFrameTree().Do(ctx) func(ctx context.Context) error {
if err != nil { frameTree, err := page.GetFrameTree().Do(ctx)
return fmt.Errorf("cannot get frame tree: %w", err) if err != nil {
} 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),
chromedp.ActionFunc( chromedp.ActionFunc(