Hello,
Thanks for your response.
Please kindly note that MS Word document is flow document and does not contain any information about its layout into lines and pages. Therefore, technically there is no “Page” and “Line” concept in Word document, and our Spire.Doc product is based on MS Word specification, so your requirement on stopping the line break for next page is not available. However, since the line numbering setting is based on each section, when you set the line numbering for the first section, it will not take effect in the other sections, so you could set the line numbering to the section in which you want to display line numbers.
For example, the code below can be used to stop displaying the sections except for the first section.
- Code: Select all
Document document = new Document();
document.LoadFromFile(input file);
document.Sections[0].PageSetup.LineNumberingStartValue = 1;
document.Sections[0].PageSetup.LineNumberingStep = 6;
document.Sections[0].PageSetup.LineNumberingRestartMode = LineNumberingRestartMode.Section;
document.SaveToFile(output file);
System.Diagnostics.Process.Start(output file);
Hope I make it clear.
Sincerely,
Jane
E-iceblue support team