No replies
joan38
joan38's picture
Offline
newbie
Last seen: 14 weeks 5 hours ago
Timezone: GMT+9
Joined: 2019-07-09
Posts: 1
Points: 4

Hi guys,

I repost this topic because the first one doesn't appear I have no idea why.

I would like some advise about one problem with pagination and I even don't know if it has solution.

The context is with twig and symphony.

I generate a PDF document
This PDF document can be in one or more than two pages.

All elements are well positioned and it work except for one row who can be longer and so it will start automatically on new page.
This one should start on the first page for example and finish and the second or third. but it will automatically start in the new page if the content will be bigger than what pagination expect to finish the current page.

So now I try to show you the result I expect:

******Page1******

column title // column content

title..............blabla
type...............blabla
description........paragraph

*********page 2 ***********
description........paragraph
-----------------------------------

And here is the result I have :

******Page1******

column title // column content

title..............blabla
type...............blabla
description........

*********page 2 ***********
................ paragraph
----------------------------------

So as above the goal is to start the description on the page 1 and continue on the page 2
I can do that inside the column title with no problem because the text is short, but the paragraph will start on the second page no matter what

 <tr class="splitable" >
                    <th>{{ 'job description'|trans }}</th>
                    <td>{{ entity.description|striptags }}</td>
                </tr>
                <tr class="splitable">
                    <th>{{ 'job description'|trans }}</th>
                    <td>{{ entity.description|purify }}</td>
                </tr>
</tr >
 

(I add space in tr tag to let you see it, if not doesn't appear on the message)
 tr.splitable {
            page-break-inside: avoid;
        }
 tr.splitable :only-child, tr.splitable td :only-child{
            page-break-inside: avoid;
            page-break-after: avoid;
            page-break-before: avoid;
}
 

So with this code, it will be impossible to let the paragraph start from the first page, and I can't do that like positioning by using pixel because in my example that page 1 and 2 but it can be 2 and 3 depend the other content.

If someone has some idea how it could be possible to do that should be helpful.

Thank you guys.