PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Jun 23, 2021 2:16 pm

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: Wed Nov 14, 2012 2:46 pm 

Joined: Fri Jul 27, 2012 11:23 am
Posts: 2
Hi all!

I'm stuck on a probably stupid thing. I use a Textframe to rotate a cell's value 90° counter clockwise. Now I need this textframe to be centered in its cell. I can't get it centered using the cells alignment property. Setting the alignment property works perfectly well when there's a paragraph in the cell but not when there's a textframe. Any hints for me? What am I missing?

This is what I'm doing:
     Paragraph paragraph = new Paragraph();
     paragraph.Format.Font.Color = Colors.Black;
     paragraph.Format.Shading.Color = new Color(192 << 16 | 192 << 8 | 192);
     paragraph.Format.Font.Bold = true;
     // Unfortunately this doesn't have any impact
     cell.Format.Alignment = ParagraphAlignment.Center;

     TextFrame verticalContent = cell.AddTextFrame();

     verticalContent.Orientation = TextOrientation.Upward;
     verticalContent.MarginBottom = Unit.FromMillimeter(3); 

Thanks a lot!

Reply with quote  
PostPosted: Wed Nov 14, 2012 4:07 pm 
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3048
Location: Cologne, Germany

I didn't try your code, but the answer could be something like
verticalContent.Left = ShapePosition.Center;

Thomas Hoevel
PDFsharp Team

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 18 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