PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Sep 28, 2024 5:21 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jul 29, 2010 8:14 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

I'm using MigraDoc to create a PDF document and have been playing around with a few different structures. I want to know which is the best way to layout a page. My documents are made up of about 8 difference blocks. Each block has a different number of columns, rows and border requirements.

Currently I have a single document section and an outer table. The outer table contains 3 columns, 1 for the left spacing, 1 for the right spacing and 1 for the contents.
All blocks are added into the centre cell of the outer table. So each block is effectively 1 row in the main outer table. The pros of this method is that I can easily adjust the left and right spacing and I can have a left and right border down the page without having to code the borders into each content block.

An alternative would be to add each block as a separate table to main section. With this approach I would have to add the right and left borders of the page to each block.

Are there any tricks or tips you can give me which will help me decide which is best.

BTW - love the product, great that we don't need any additional infrastructure like SSRS and it automatically calculates what can fit on a page.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 29, 2010 9:51 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

After further investigation it appears that the first approach is not a very good one. This does not allow for the inner table to automatically continue onto a new page.
I.e. if I have one row in the outer table and 20 rows in the inner table (located in OuterTable[0,1]) then the inner table will not split onto a new page if required.

Instead it looks like I need to Add each block to the main section. The problem with this approach is that there is no way to Keep one table in the section with another table in the section. E.g. in the example below I want to keep table 1 with table 2

Section
- Table 1
Row 1 cell 1, row 1 cell 2, row 1 cell 3
Row 2 cell 1, row 1 cell 2, row 1 cell 3
Row 3 cell 1, row 1 cell 2, row 1 cell 3
- Table 2
Row 1 cell 1
Row 2 cell 1

The only way I can think of to keep Table 2 with Table 1 is to have Table 2 internal to Table 1. i.e.
Section 1
- Table 1
Row 1 cell 1, row 1 cell 2, row 1 cell 3
Row 2 cell 1, row 1 cell 2, row 1 cell 3
Row 3 cell 1, row 1 cell 2, row 1 cell 3
Row 4 cell1.MergeRight 2
- Table 2
Row 1 cell 1
Row 2 cell 1

I just hope Table 1 will now automatically split over to a new page if it contains too many rows.

Cheers


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 34 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