PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Sep 01, 2009 9:31 am 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
I tried to put the long table into a TextFrame and then set the TextFrame to center. But the TextFrame won't expand to multiple pages, so the table was cut off.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 01, 2009 11:13 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
One way: use sections
Knowing the width of the table and the width of the paper, you can easily center the table using document.LastSection.PageSetup.LeftIndent.

This settings affects everything in the section, but you can change the LeftIndent of any paragraph or shape in the section. You can also use negative values to compensate for the table indentation.

You can create as many sections as you need - but a new section always starts with a pagebreak.

Another way: use dummy columns
You can also add a column at the left of the table. Leave this column empty. Set border, color, and content only for the non-dummy columns of the table.
Calculate the width of the dummy column based based on the width of the paper and the table.

This may require some adjustments at your code that creates the table.

What's best?
That depends on your table and your needs.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 01, 2009 2:42 pm 
Offline

Joined: Wed Aug 19, 2009 4:04 am
Posts: 10
Thomas,

Thanks for the answer. But it should be a place for improvement of PdfSharp. Can I expect it in near future?

BTW, I will use dummy columns.

Regards


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 01, 2009 4:15 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
t800t8 wrote:
But it should be a place for improvement of PdfSharp. Can I expect it in near future?

I put it on the MigraDoc wish list - but I can't say when it'll come.

Until you asked (in that other thread) I didn't even know that tables don't support indentation (or if they do, I missed it).

Our applications only use left-aligned or full-width tables. And I don't recall anybody else asking for it.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu May 12, 2011 1:00 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!

This feature is implemented, but not where I expected it.

Set table.Rows.LeftIndent to indent table.
To center the table, calculate the appropriate indentation.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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