Dear Josef,
Sorry for late reply as weekend.
Please 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, our Spire.Doc product is based on MS Word specification, so it is impossible to remove empty pages.
Moreover, I checked your sample file and noticed the "empty page" you mentioned only has one row. So you could remove the three rows, then the "empty pages" will be removed.
- Code: Select all
Document doc = new Document(@"F:\UnitTestTemplate-success.docx");
Table table = doc.Sections[0].Tables[0] as Table;
int count = table.Rows.Count;
//From the third row, delete these rows
for (int i = 2; i < count;i++ )
{
//remove the rows
table.Rows.RemoveAt(2);
}
doc.SaveToFile("11239.docx", FileFormat.Docx);
If there is any question, please let me know.
Sincerely,
Betsy
E-iceblue support team