390
Views
7
Comments
Solved
[Ultimate PDF] Container content breaking between pages
Question
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes

Hello everyone.

I'm currently facing an issue when generating a PDF, where content that is supposed to be shown together in a page, is breaking in two.

Below is a picture of an example where the red box is the header of the next page, the green is the content that is not supposed to break, and in blue the next content section.

I've tried applying CSS classes and UltimatePDF WBs to attempt to force a page break before the first section (break-before:always), or to avoid breaking (break-inside:avoid), but to no avail.

Below is a picture of the structure of the WB, which is then used on the main screen to be downloaded 

The Operations Cnt is where i attempted to apply said classes.


Any suggestions on how to proceed?

Thanks.

2024-01-06 15-04-40
moussa saidi
Solution

If you still need the answer. There is a block called AvoidBreak inside the UltimatePDF module you can use and any content you'll add inside it it will not break.


2025-02-20 09-44-55
Rodrigo Alves

Hello Moussa, unfortunately that block did not work for my use case.

I've tried many tricks to make it work but to no avail.

What did work was restructuring the CSS on the page, making sure no conflicts where happening between classes (display: inline-block usually interferes with these things, as well as some other ones like certain flex attributes).

That did the trick

2022-09-05 08-23-51
Naveen N

@Rodrigo Alves  If possible can you attach a oml.

2025-02-20 09-44-55
Rodrigo Alves

Hi Naveen, unfortunately i can't upload the OML, but i can provide you with the information you may require

2022-09-05 08-23-51
Naveen N

Yes, I understand you cannot attach official one but create a same scenario in your personal environment with dummy content and attach that oml. I hope mostly it will be a css fix.

2018-08-15 15-09-17
Erdem Birinci

Hi @Rodrigo Alves,
If you fixed the issue, could you please provide your solution? 

2024-01-06 15-04-40
moussa saidi

Check my answer if you still interested

2024-01-06 15-04-40
moussa saidi
Solution

If you still need the answer. There is a block called AvoidBreak inside the UltimatePDF module you can use and any content you'll add inside it it will not break.


2025-02-20 09-44-55
Rodrigo Alves

Hello Moussa, unfortunately that block did not work for my use case.

I've tried many tricks to make it work but to no avail.

What did work was restructuring the CSS on the page, making sure no conflicts where happening between classes (display: inline-block usually interferes with these things, as well as some other ones like certain flex attributes).

That did the trick

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.