feat: better PDF

This commit is contained in:
2025-08-24 00:24:40 +02:00
parent 0267e6e578
commit 5b664234e9
18 changed files with 540 additions and 228 deletions

View File

@@ -25,14 +25,15 @@ func (s Service) HtmlToPdf(html string) (pdf io.ReadCloser, err error) {
}
req := gotenberg.NewHTMLRequest(index)
req.PaperSize(gotenberg.A4)
req.Margins(gotenberg.PageMargins{
Top: 0.5,
Bottom: 0.5,
Left: 0.5,
Right: 0.6,
Unit: gotenberg.IN,
})
// req.Margins(gotenberg.PageMargins{
// Top: 0.5,
// Bottom: 0.5,
// Left: 0.5,
// Right: 0.6,
// Unit: gotenberg.IN,
// })
req.Margins(gotenberg.NoMargins)
// Skips the IDLE events for faster PDF conversion.
req.SkipNetworkIdleEvent(true)
req.EmulatePrintMediaType()