Hello,
I am using the Spire reference to get a document template and replace an word with a Table. The problem that I am having is that whenever I replace the word with the table and save the document to PDF, it adds an extra blank page.
code sample:
Section section = document.AddSection();
TextSelection selection = document.FindString(Word, True, True);
TextRange range = selection.GetAsOneRange();
Paragraph paragraph = range.OwnerParagraph;
Body body = paragraph.OwnerTextBody;
int index = body.ChildObject.IndexOf(paragraph);
Table table = section.AddTable(true);
table.ResetCells(#,#);
table.AutoFit(AutoFitBehaviorType.AutoFitContents);
table.TableFormat.IsBreakAcrossPage = True;
body.ChildObjects.Remove(paragraph);
body.ChildObjects.Insert(index, table);