PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 1:22 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Apr 10, 2008 9:32 am 
Offline

Joined: Tue Apr 01, 2008 10:10 am
Posts: 4
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 10, 2008 10:18 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 10, 2008 12:46 pm 
Offline

Joined: Tue Apr 01, 2008 10:10 am
Posts: 4
I tried rendering same
MigraDoc.DocumentObjectModel.Document with
MigraDoc.RtfRendering.RtfDocumentRenderer
but unfortunately results are identical.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 06, 2009 6:49 am 
Offline

Joined: Fri Oct 24, 2008 12:24 pm
Posts: 13
Location: Brisbane, Australia
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 :evil: )

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!

:idea: 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?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 23, 2009 4:59 am 
Offline

Joined: Fri Oct 24, 2008 12:24 pm
Posts: 13
Location: Brisbane, Australia
Hi Thomas,

Are there any plans to incoporate large cell content automatically breaking on to the next page as a feature in a future release? If so do you have any ballpark estimates of when that might be available?

Failing that could you provide some pointers as to what would be involved in incorporating such functionality myself. I'd happily contribute back to the project any solution that I come up with if that were possible.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 23, 2009 2:34 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
The next release 1.3 (coming this summer) won't have this feature.
It's on our TODO list, but I can't say when it'll be implemented.

Layouting and rendering are not my areas of expertise, so I can hardly give you any clues on where to start.
Search the place where RenderInfo.LayoutInfo.ContentArea gets filled.
Maybe there is only one ContentArea for a table cell now - that would have to be changed to allow table cells across pages.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 27, 2010 11:42 pm 
Offline

Joined: Fri Oct 24, 2008 12:24 pm
Posts: 13
Location: Brisbane, Australia
hi Thomas - it's make or break time for my project and the only sticking point we have is this overflowing cell issue. Do you have any idea whether this problem is being promoted from the TODO list and if so when?

I have tried looking through the code ( :shock: ) to see if I could work out how to do the job myself but the knowledge required is somewhat beyond me at this stage unfortunately.
We may have to use other products if I can't find a work aound for this - but either way I think that you have a great product here as, bar this issue, it has stood up to or requirements admirably so far.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 422 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group