Header row styles not continuing on next page

Hi,


I am using Aspose 11.0.0 PDF java version.

I am using the following code to generate a table.

private static Table getDataTable() {
Table table = new Table();

// header row 1
Row row = table.getRows().add();
Cell cell = getCell(-1,-1);
cell.setRowSpan( 2 );
cell.setBackgroundColor( Color.getAqua() );
row.getCells().add(cell);
for( int j = 0; j < 4; j++ ){
cell = getCell(-1,-1);
cell.setBackgroundColor( Color.getAqua() );
row.getCells().add(cell);
}
// header row 2
row = table.getRows().add();
for( int j = 0; j < 4; j++ ){
cell = getCell(-1,-1);
cell.setBackgroundColor( Color.getAqua() );
row.getCells().add(cell);
}
for( int i = 0; i < 1000; i++ ) {
row = table.getRows().add();
for( int j = 0; j < 5; j++ ){
cell = getCell( i, j );
row.getCells().add(cell);
}
}
table.setColumnWidths( "200 200 200 200 200 " );
table.setRepeatingRowsCount( 2 );
return table;
}
private static Cell getCell( int i, int j ) {
TextSegment segment = new TextSegment( "row “+i+” cell "+j );
//TextSegment segment = new TextSegment( “This is some sample text” );
TextState state = segment.getTextState();
state.setFont( FontRepository.findFont(“Verdana”) );
state.setForegroundColor( Color.getGreen() );
state.setBackgroundColor( Color.getWheat() );
state.setFontSize( 15f );
TextFragment textFragment = new TextFragment();
textFragment.getSegments().add( segment );
Cell cell = new Cell();
cell.getParagraphs().add( textFragment );
BorderInfo info = new BorderInfo();
GraphInfo ginfo = new GraphInfo();
ginfo.setLineWidth( 2 );
ginfo.setColor( Color.getBlack() );
info.setTop( ginfo );
info.setLeft( ginfo );
info.setRight( ginfo );
info.setBottom( ginfo );
cell.setBorder( info );
MarginInfo mInfo = new MarginInfo( 5, 5, 5, 5 );
cell.setMargin( mInfo );
return cell;
}

The table has 2 row as header row that should be repeated with its styles.
The first cell has a row span of 2.

The header row text styles are maintained on the first page but the they disappear for the rest of the pages.
The image ( header row styles first page.png ) shows the styles on first page.

The image ( header row styles rest pages.png ) shows the styles on the rest of the pages

How do I maintain these styles ?

The first cell in header row which had row span the cell in not properly plotted in the final PDF( check any image attached.).

How do I also achieve this ?

Hi Saurabh,

Thanks for your inquiry. I have tested your scenario using Aspose.Pdf for Java 11.2.0 and managed to observe the reported issue of Header row style. For further investigation, I have logged an issue in our issue tracking system as PDFNEWJAVA-35613 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
Calibri;color:#333333;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>Best Regards,

Hi,


Any update on the issue PDFNEWJAVA-35613 ?

Does PDFNEWJAVA-35613 also handle the rowspan problem that I have shown above ?


SaurabhMayekar:
Hi,Any update on the issue PDFNEWJAVA-35613 ?
Hi Saurabh,

Thanks for contacting support.

As we recently have noticed this problem, so its pending for review. However the product team will surely start investigating/fixing this problem, as per their development schedule.

SaurabhMayekar:
Does PDFNEWJAVA-35613 also handle the rowspan problem that I have shown above ?
The issue is logged with a context that header row styles are not continuing on subsequent pages. However concerning to rowspan issue, we are further looking into this matter and will get back to you soon.

The issues you have found earlier (filed as PDFNEWJAVA-35613) have been fixed in Aspose.Pdf for Java 11.6.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.