Repeat table headers

Hi we have aspose.words to generate documents. We have given users options to save the document either as a PDF or WORD doc.

When we set the property builder.getRowFormat().setHeadingFormat() to true, we see table headers repeated across pages when saved as WORD doc. But when we save the same document as PDF, the table headers wont repeat. Is there a way we can achieve this with aspose.words?

@adevabhaktuni This should work for both DOCX and PDF. I have used the following code for testing and the heading row is repeated properly in both DOCX and PDF:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Table table = builder.startTable();
// Heading row
for (int i = 0; i < 5; i++)
{
    builder.insertCell();
    builder.write("Heading Row");
}
builder.getRowFormat().setHeadingFormat(true);
builder.endRow();

// Data rows
builder.getRowFormat().setHeadingFormat(false);
for (int j = 0; j < 100; j++)
{
    for (int i = 0; i < 5; i++)
    {
        builder.insertCell();
        builder.write("Data Row");
    }
    builder.endRow();
}

builder.endTable();

doc.save("C:\\Temp\\out.docx");
doc.save("C:\\Temp\\out.pdf");

out.docx (8.0 KB)
out.pdf (27.8 KB)