Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a feature to require a minimum height on the page before drawing a div, and if not, break to the next page? #469

talonlzr opened this issue Apr 23, 2019 · 1 comment


None yet
1 participant
Copy link

commented Apr 23, 2019

I have a lot of divs in a long list of divs, and now and then, three divs occur after each other that I want grouped together on the same page.

I'm looking for something like:

<require_page_space min_height="40mm">
   <div>My first DIV</div>
   <div>Second DIV</div>
   <div>Third DIV</div>

...where it would break before the first div if there isn't at least 40mm of space available on the page.

Does something like this exists?


This comment has been minimized.

Copy link

commented Apr 23, 2019

I tried to make this tag myself since I figured it would be quite easy, but inside my _tag_open_require_page_space() function, how to I get where the "current" insert point of the PDF is? I figured this would be $this->pdf->GetY() and $this->pdf->GetX() but it seems these are always 0? I found methods to grab the page height, the top/bottom margins etc, so I guess all thats left to figure out is the page position we're currently at, and then I can call $this->_setNewPage(); to force a new page prior to rendering my content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.