jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.29k stars 772 forks source link

bottom margin for custom size pdf #327

Closed schooltech closed 4 years ago

schooltech commented 4 years ago

I created a 10cm*7.5cm pdf document, and set the margin to 0.5cm. The result is as shown in the figure, but the margins below are very large. If the pdf document is reduced in height, for example, it is changed to 7.0cm. The document becomes like this. How to solve? Thank you.

pdf1 pdf3

jung-kurt commented 4 years ago

You may want to disable automatic page breaks; see SetAutoPageBreak(). By default, automatic page breaks are enabled and the bottom margin is set to 2 cm, regardless of the custom page size.

Alternatively, you can set the page break margin with a call to the same method, but I think in the case of tables it makes more sense to disable automatic page breaks.

schooltech commented 4 years ago

That's great, Thank you