PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Jul 10, 2024 2:27 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Table Positioning
PostPosted: Mon Jun 27, 2011 2:52 pm 
Offline

Joined: Mon Jun 27, 2011 2:41 pm
Posts: 2
I need to create a page footer that has 5 small tables in it. The first 4 tables are all on the same horizontal line in the footer. Each of these 4 tables has 2 rows. I was able to get the 4 tables to work properly and be spaced correctly by using the code below and setting the XX in "XXcm" to the amount I needed to indent for each (the code is a sample of one of the 4 tables).

Once I added my 5th table that needed to be below the first 4 tables I ran into a big issue. The table just sat on top of the other 4 tables. I tried putting the first 4 tables into 1 TextFrame and the 5th into another and that did not solve the problem. In fact, it created a new issue because each of the first 4 tables showed up like set of descending stairs, each table lower than the last, and the 5th table still showed up over top of my first table. How do I fix this?

Code:
footerTable = footerFirstLine.AddTable();
footerTable.Style = "Table";
footerTable.Borders.Color = TableBlackBorder;
footerTable.Borders.Width = 0.25;
footerTable.Rows.LeftIndent = "XXcm";

column = footerTable.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Center;

row = footerTable.AddRow();
row.HeadingFormat = true;
row.Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].AddParagraph(" Quotation #:");
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Center;

row = footerTable.AddRow();
row.HeadingFormat = true;
row.Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].AddParagraph("E######");
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Center;


Top
 Profile  
Reply with quote  
 Post subject: Re: Table Positioning
PostPosted: Mon Jun 27, 2011 3:54 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Do you really need 5 tables?

A lot can be done with one table and some MergeRight and/or MergeDown. You can set the borders per cell, so it can look like 5 tables while it's actually one.

TextFrames are Shapes and offer various options to position them - and various options to make something wrong ...

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Table Positioning
PostPosted: Mon Jun 27, 2011 9:53 pm 
Offline

Joined: Mon Jun 27, 2011 2:41 pm
Posts: 2
I didn't know I could remove borders per cell. How do I do that? Once I can do that then yes, 1 table would work perfectly well.

Also, could you tell me how to doing positioning with text frames? I just want to understand so if I do need it in the future it won't be impossible.

Is there a guide somewhere on what all of the controls are in Migradoc and what the options are and what each one actually controls? I am running VS2010 and the help stuff isn't working at all. I tried to follow the instructions codeplex on how to use the help but there are 0 files under the help folder from what I downloaded and it is very frustrating.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 44 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