View previous topic :: View next topic |
Author |
Message |
yogesh@performixinc.com
Joined: 01 Apr 2008 Posts: 4
|
Posted: Thu Apr 10, 2008 9:32 am Post subject: Table Cell with huge amount of text |
|
|
I am trying to add a table to the document.
This table has 2 columns and 2 rows (code shown below).
Assuming that table starts on Page-1 and if text in second
row and second column is really huge, I have following problems.
1) Second row of the table starts on Page-2, even though first
row hardly occupies any Page-1 height
2) Second row which starts on a new page, does not fit in one page,
so I expected it to continue on Page-3, but instead table gets
truncated on Page-2, without complete text and table border on
bottom row.
Is there way to get around both these problems?
Table table = new Table();
Column column = table.AddColumn(Unit.FromCentimeter(2));
column.Format.Alignment = ParagraphAlignment.Center;
column = table.AddColumn(Unit.FromCentimeter(5));
Cell cell;
// Add first Row
Row row = table.AddRow();
row.Shading.Color = Colors.PaleGoldenrod;
cell = row.Cells[0];
cell.AddParagraph("Itemus");
cell = row.Cells[1];
cell.AddParagraph("Descriptum");
// Add second Row
row = table.AddRow();
cell = row.Cells[0];
cell.AddParagraph("2");
cell = row.Cells[1];
cell.AddParagraph(HugeAmoutOfText);
table.SetEdge(0, 0, 2, 2, Edge.Box, BorderStyle.Single, 1, Colors.Black);
document.LastSection.Add(table);
Regards, Yoegsh |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Thu Apr 10, 2008 10:18 am Post subject: |
|
|
It is by design that table cells will not break to the following page.
I have no idea for a workaround if you need PDF directly.
Your table might work if you create an RTF file. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
yogesh@performixinc.com
Joined: 01 Apr 2008 Posts: 4
|
Posted: Thu Apr 10, 2008 12:46 pm Post subject: |
|
|
I tried rendering same
MigraDoc.DocumentObjectModel.Document with
MigraDoc.RtfRendering.RtfDocumentRenderer
but unfortunately results are identical. |
|
Back to top |
|
|
Orestone
Joined: 24 Oct 2008 Posts: 7 Location: Brisbane, Australia
|
Posted: Mon Apr 06, 2009 6:49 am Post subject: |
|
|
Thomas Hoevel wrote: | It is by design that table cells will not break to the following page.
I have no idea for a workaround if you need PDF directly |
I've just run in to this issue myself where a cell is too big to fit on a single page (God 'bless' Testers )
Does a workaround for this kind of functionality fall in to the 'too hard basket'? This feature alone may be anough to stop our project from using it - and I have been blowing PdfSharp's trumpet hard!
would it be possible to perform a TextMeasurement of the cell contents and then manually split it all up if you can determine that it is too big to fit on the page? |
|
Back to top |
|
|
|