Free Support Forum - aspose.com

Inserting and Freezing the table on the top of each page

Hi I have a question,
Is there any option in Aspose words where we can detect the top of the page and then insert the table there and freeze it by unchecking “Move with Text” under Table Positioning option. Please refer to the screen shot attached.

Basically we want to insert a freezed 1 row table on top of each page.
Sample table.pdf (115.9 KB)

Note: you can change the PDF to Doc file and try moving the text around the sample table.

@cvsformulary,

Thanks for your inquiry. In your case, we suggest you please insert the table in the header of document. Please move the cursor to the header of document using DocumentBuilder.MoveToHeaderFooter method and insert the table. Hope this helps you.

If you still face problem, please ZIP and attach your expected output Word document here for our reference. We will then provide you more information about your query.

Thankyou so much for the quick reply.

Please find attach the zip. It has a sample Doc file which has the freezed table on top of 2nd page. This is what we are trying to achive.Sample Document.zip (10.5 KB)

In case, we want to consider ‘Header of the document’ option. Is there a way to define different header for First page and rest of the pages. Also different headers in between the sections of the documents.

@cvsformulary,

Thanks for sharing the detail.

Please use Table.TextWrapping property to achieve your requirement. Please set its value as ** TextWrapping.Around** for the desired table. We suggest you please read following artice.
Table Position

Please check the HeaderFooterType Enumeration. In this case, you need to insert the table in the header of Section of type HeaderFirst and HeaderPrimary. For different header and footer, please set the value of Section.PageSetup.DifferentFirstPageHeaderFooter property as true.