We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Prevent Section from spanning multiple pages?

In a PDFLogicDocument, I have three sections, the middle one being arbitrarily large. By default, I would like there to be no page breaks between these sections. However, if the middle section is large enough such that one page is not possible, I need the page break to fall between sections.

So what I''m asking is if there is anyway to force a section to display all on one page without always starting a new page before or after?

1 Reply

AJ Ajish Syncfusion Team July 28, 2006 09:30 PM UTC

Hi Scott,

Use the following code to create a create a new section on the current page

//Add a section in the PDF document.
IPDFSection section = pdflDoc.AddSection();

//Set section break property.
section.BreakCode =SectionBreakCode.NoBreak;

Here is a sample for your reference:
Sample.zip


Please take a look and let me know if you have any questions.

Best Regards,
Ajish.

Loader.
Live Chat Icon For mobile
Up arrow icon