johnfercher / maroto

A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.
https://maroto.io
MIT License
1.48k stars 172 forks source link

Make maroto dimensions and current height public values #402

Closed david-kalmakoff closed 2 months ago

david-kalmakoff commented 3 months ago

Is your feature request related to a problem? Please describe.

The issue I ran into was trying to make sure items fit on the page or manipulate how they would spill onto the next page. To do this, I had to track the dimensions of the page, margins and current estimated height externally.

Describe the solution you'd like

Add getter methods to maroto to get the values currentHeight, documentWidth, documentHeight, availableWidth, availableHeight.

Describe alternatives you've considered

Another useful thing would be to add a checker method to see if the rows you are adding would spill into the next page.

Additional context