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

Open
talonlzr opened this issue Apr 23, 2019 · 2 comments

Comments

@talonlzr
Copy link

talonlzr 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>
</require_page_space>

...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?

@talonlzr
Copy link
Author

talonlzr 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.

@Hatchberries
Copy link

Hi talonlzr can you please help me for find a solution for my problem.
I am loading a page with dynamic data. I have different section each section contains heading and data's. The issue is when the section is end and the new section if the page only contains space to accommodate the section title, only in such case can i able to move the title to next page . Can you please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants