Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Nov 28, 2022 2:37 pm

Hi,

Can you share how we can make table header visible when the table extends to a new page.

suryaks2002
 
Posts: 17
Joined: Wed Nov 09, 2022 7:57 am

Tue Nov 29, 2022 10:00 am

Hi,

Thanks for your inquiry.
Please refer to the following code to achieve what you want.
If you are using Spire.Doc to operate Word table:
Code: Select all
//Add a new row or get an existing row
TableRow row = table.AddRow(); //TableRow row = table.Rows[0];
//Set the row as a table header
row.IsHeader = true;



If you are using Spire.PDF to operate PDF table:
Code: Select all
PdfDocument pdf = new PdfDocument();
// add new page
PdfPageBase page = pdf.Pages.Add();
PdfGrid grid = new PdfGrid();
grid.Columns.Add(3);
PdfGridRow[] pdfGridRows = grid.Headers.Add(1);
...// TODO : fill the header cells...
grid.RepeatHeader = true;
......
grid.Draw(page, new PointF(0, 20));

If you encounter any problems while you are using our products, just feel free to contact us.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Dec 01, 2022 9:55 am

Hi,

Greetings from E-iceblue.
Does the code I provided meet your requirement? I’m looking forward to your feedback. If there is any problem with our products, just feel free to contact us.

Have a nice day!


Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF

cron