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.

Tue Feb 11, 2025 7:26 am

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

graver0206
 
Posts: 5
Joined: Sun Feb 09, 2025 2:33 pm

Tue Feb 11, 2025 8:54 am

Hi,

Thanks for your feedback.
I have reproduced this issue and logged it into our bug trackings system with the issue ID: SPIREDOC-11092. Our dev team will investigate and fix it. Once it is resolved or there is any update, I will notify you immediately. Apologize for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Mar 21, 2025 6:21 am

Hi,

What's the status on this issue ?

Best regards,
Søren Graversen

graver0206
 
Posts: 5
Joined: Sun Feb 09, 2025 2:33 pm

Fri Mar 21, 2025 10:12 am

Hi,

Sorry your issue has not been resolved yet. I have urged our dev team to expedite the process. Please allow us some more time. If there is any good news, I will inform you immediately. Thank you for your understanding.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Sun Jan 25, 2026 9:59 pm

I found exactly the same issue. please provide update. If the issue has not be resolved, do you have a workaround?

kevin.xu
 
Posts: 2
Joined: Wed Oct 29, 2025 7:59 am

Mon Jan 26, 2026 3:34 am

Hi,

Sorry, but this issue hasn't been fully resolved yet. After investigation, we found it's caused by the table's text wrapping being set to "Around." As a temporary workaround, we recommend changing the wrapping option to "None" to avoid this problem. See the setting below.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Mon Jan 26, 2026 10:09 am

Great, it works for me!

kevin.xu
 
Posts: 2
Joined: Wed Oct 29, 2025 7:59 am

Tue Jan 27, 2026 2:11 am

Hi,

Thanks for your feedback.
Should we eventually address this problem at its root, I will be sure to update you here as well. Thank you for your understanding.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc