PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 01, 2024 4:21 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Aug 20, 2009 2:33 am 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
I tried to search on the forum but didn't find any answer.

I want to put a table at the center of the page, how can I do it?

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 20, 2009 10:16 am 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
I mean by MigraDoc.

Nobody can help?


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 21, 2009 2:09 am 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
Found the question myself.

To center a table on a page, you need to add it to a TextFrame then set TextFrame.Left = ShapePosition.Center. And you MUST set value for TextFrame.Width.

Funny that if I don't set value for TextFrame.Width, it's 0, but the table still appears.

Hope that help somebody.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 25, 2009 8:46 pm 
Offline

Joined: Tue Aug 25, 2009 8:13 pm
Posts: 1
thanks

On a related note, here is how I moved the table farther left:
Code:
addressFrame.MarginTop = "0.5cm"     //space above table
addressFrame.Height = "5cm"          //height of table
addressFrame.MarginLeft = "-1cm"     //position to the left of margin


Or to move the margins for the whole section instead:
Code:
section.PageSetup.LeftMargin = "1cm"    //use small page margins (tables can be farther left)
section.PageSetup.RightMargin = "1cm"   //use same margin on right so center will work correctly


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 31, 2009 8:58 am 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
The problem is now change to "How to center a long table which expand on multiple pages?"

For a short table (fit into one page), it's OK to put it into a TextFrame. But as I tried, the TextFrame didn't expand on multiple pages, so the table was cut.

How to center a long table which expand on multiple pages?


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 06, 2013 1:03 am 
Offline

Joined: Fri Mar 01, 2013 9:17 pm
Posts: 4
See this thread: http://forum.pdfsharp.net/viewtopic.php?f=2&t=856


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

All times are UTC


Who is online

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