Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Mar 09, 2017 1:36 pm

Hi

I have to create a word dokument with several lists with
variable length. Sometimes a paragraph is too big for one page, so it will add a page break.

Is there a solution to prevent page breaks within a paragraph?

Is there a solution to find out when a page break happens ? And then to set a section break before the
affected paragraph?

Sorry for my bad englisch
Kind regards

max90
 
Posts: 4
Joined: Thu Mar 09, 2017 1:21 pm

Fri Mar 10, 2017 1:59 am

Dear max90,

Thanks for inquiry.
Please use following code to keep the paragraph on one page.
Code: Select all
Paragraph.Format.KeepFollow = true;

If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Mar 10, 2017 8:44 am

Hi

I tried that already, but it didn't work.

Is there any other solution?

Kind regards

max90
 
Posts: 4
Joined: Thu Mar 09, 2017 1:21 pm

Fri Mar 10, 2017 9:06 am

Dear max90,

Thanks for your feedback.
Please try to use following code.
Code: Select all
Paragraph.Format.KeepLines = true;

If the issue still exists, please provide us input file and the code you were using so that we can reproduce the issue on my side.


Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Mar 10, 2017 9:22 am

Hi

that worked for me.
Thank you very much.

Kind regards

max90
 
Posts: 4
Joined: Thu Mar 09, 2017 1:21 pm

Fri Mar 10, 2017 9:28 am

Dear max90,

Thanks for the feedback.
Any question, please let us know, we will be happy to help you :) .

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc