1

Using MigraDoc only (no PDFsharp), I have a number of tables that break across pages. These tables have an outer border, and when the pages break, the borders continue on the next page. These are desired behaviors.

Additionally, I need to add a border to the bottom of the last row of a table on a page, and to the top of a row of a table at the start of the next page, where the table is split. Ideally, I would like to detect if a row will be the last on a page before breaking and address it then.

My question is, do any MigraDoc developers out there know of a way to detect if an element (including table rows) will be the last element of an existing page?

1 Answer 1

0

MigraDoc describes documents with sections and paragraphs - pages do not exist at this level.

You can use the PDF renderer to prepare the document. At this stage, pages exist. Now you can change the borders of the rows at the bottom / at the top. If you only change the appearance of the borders, but not the width, then you can create a PDF (using PDFsharp) with the desired look.

There is no automatism that changes the appearance of borders at the bottom / at the top of the page.

This approach cannot be used when creating RTF documents.

Sign up to request clarification or add additional context in comments.

2 Comments

It seems that using PDFSharp is the solution here. It allows you to craft documents with more specificity and I would be able to calculate and measure to detect which rows would be able to fit before a page break occurs. I'll pursue this as the solution in the next build. Thank you for the swift answer.
It would be great help .If you would please provide the code for this solution .I am using only Migradoc and not able to give the bottom border if table breaks into multiple pages .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.