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

Inserting a new page break if inserted text or table goes across to the next page

Hi,

I am inserting text and tables into a middle of an existing document. Sometimes the table may spread across on to the next page in the document. If this happens I would like to be able to insert a page break before the table is inserted so that the table appears on its own page and is not split across two pages. What is the best way to do this ?

My intentions was to do the following :

1. Create a bookmark before the table is inserted, and get the current page count.
2. Insert the table, then get the current page count. If the current page count has increased I would then go back to the bookmark and insert a page break.

To do this I would need to get the current page count.


3 Replies

SK Sathish K Syncfusion Team May 13, 2014 08:44 AM UTC

Hi Chris,

 

Thank you for your interest in Syncfusion products.

 

We have prepared a sample to meet your requirement that to insert a table after a bookmark and to insert a page break after bookmark if page count is increased. Please find the attached sample and let us know if this helps you.

 

Please let us know if you have any other questions.

 

Regards,

Sathish


Attachment: Sample_1eedcf5f.zip


CC Chris Crowhurst May 13, 2014 02:22 PM UTC

Thanks that worked a treat!



SK Sathish K Syncfusion Team May 14, 2014 08:53 AM UTC

Hi Chris,

 

Thank you for your update.

 

Happy to hear from you. It is our please to know that the updated sample has met your requirement. Please let us know if you need any further assistance. We will be happy to assist you as always.

 

Regards,

Sathish


Loader.
Live Chat Icon For mobile
Up arrow icon