Hi
I am considering your product for at delivery note project. I have created a delivery note template (.docs) with headers/footers, some bookmarks and then a table with a repeatable header and ONE row.
My code then replaces the bookmarks text and then finds the table using a bookmark. The table has a "Repeatable header" and then I add rows by code. When the number of lines exceeds one page, the table is continued on the next page.
When I save the document as .docx the the header is repeated fine on the next page(s). However my requirement is to save as pdf - but here the header is NOT repeated on the next pages.
Can you help ?
Here is my code:
Spire.Doc.License.LicenseProvider.SetLicenseKey("xxxx);
var doc = new Document();
doc.LoadFromFile(@"C:\temp\wordmerge\spiresupport\template.docx");
Section sec = doc.Sections[0];
TableRow bookmarkRow = null;
foreach (Bookmark bookmark in doc.Bookmarks)
{
if (bookmark.Name == "LineRow")
{
bookmarkRow = bookmark.BookmarkStart.Owner.Owner.Owner as TableRow;
}
}
// Fill table
Table table = bookmarkRow.Owner as Table;
for (int row = 1; row < 16; row++)
{
TableRow rowClone = bookmarkRow.Clone();
int i = 0;
foreach (Spire.Doc.TableCell curCell in rowClone.Cells)
{
i++;
var par = curCell.Paragraphs[0];
par.AppendText($"L{row}F{i}");
}
table.Rows.Add(rowClone);
}
table.Rows.RemoveAt(1); // delete bookmarked line which is just used for cloning.
doc.SaveToFile(@"C:\temp\wordmerge\spiresupport\out.pdf", FileFormat.PDF); // ERROR: Repeatable headers are NOT repeated on page 2+
doc.SaveToFile(@"C:\temp\wordmerge\spiresupport\out.docx"); // SUCCESS: Repeatable headers works fine