Table with Repeat Header Row difference between PDF and DOCX

Hello,

I have issue with exporting table with Repeat Header Row functionality. Received DOCX and PDF differs a lot, Word as expected ignores this prop when header will be bigger then one page (so as result we have two pages), PDF from the other hand tries to respects this props and generate 12 pages.
Here are example files:
pdf (29.1 KB)
docx (7.8 KB)

And here is code which is used to generate these files:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
var table = builder.startTable();
builder.insertCell();
builder.getCellFormat().setWrapText(true);
for (int t = 0; t < 1000; t++)
  builder.write("aaaaaa ");
builder.insertCell();
builder.insertCell();
builder.insertCell();
builder.getRowFormat().setHeadingFormat(true);
builder.getRowFormat().setAllowBreakAcrossPages(true);
builder.endRow();
for (int rows = 0; rows < 10; rows++) {
  builder.getRowFormat().setHeadingFormat(false);
  builder.getRowFormat().setAllowBreakAcrossPages(true);
  builder.insertCell();
  builder.insertCell();
  builder.insertCell();
  builder.insertCell();
  builder.endRow();
}
builder.endTable();
table.setAllowAutoFit(true);

Can you help how to force PDF to behave like Word?

@PROCUREMENT2 Thank you for reporting the problem to us. For a sake of correction it has been logged as WORDSNET-24255. We will keep you updated and let you know once it is resolved or we have more information for you.

Hi @alexey.noskov, any updates on this?

@PROCUREMENT2_DFINSOLUTIONS_COM The issue is currently in analysis. The issue happens because Aspose.Words handles header row breaking differently in compatibility mode compared to MS Word.

In 2013 and later the header row must be broken. In compatibility mode it must be clipped on the first page and on the subsequent page only regular row shall appear, like if there is no header row. Aspose.Words in compatibility mode however clips the header row on a first page and fits the minimum content after it (even if beyond the page) and keeps doing this until all content is positioned.