PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 11, 2024 10: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: Tue May 17, 2011 12:53 pm 
Offline

Joined: Tue May 17, 2011 12:48 pm
Posts: 1
Hi!

I'm trying to use a Table to create three columns on a page. However, no matter what I specify for their widths, they simply use a default size in both horizontal and vertical direction:

Image

I'm creating the table like this:

Code:
var layoutTable = headerSection.AddTable();
Column patientColumn = layoutTable.AddColumn("10cm");
Column patientPaddingColumn = layoutTable.AddColumn("1cm");
Column dosageColumn = layoutTable.AddColumn("10cm");
Column dosagePaddingColumn = layoutTable.AddColumn("1cm");
Column cyclesColumn = layoutTable.AddColumn("10cm");
layoutTable.AddRow();

var patient = this.plan.TreatmentPatient;
{
  TextFrame patientFrame = layoutTable[0, 0].AddTextFrame();
  patientFrame.LineFormat.DashStyle = DashStyle.SquareDot;
  patientFrame.LineFormat.Width = Unit.FromPoint(0.5);

  patientFrame.AddParagraph(patient.LastName + ", " + patient.FirstName).Style = "Big";
}


As you can see in the screenshot above, the column widths are completely ignored by MigraDoc.

Any ideas what I might be doing wrong?


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2011 7:21 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Cygon wrote:
Any ideas what I might be doing wrong?

Why do you use "AddTextFrame()"?
You place the TextFrame inside the Table, then add text to the TextFrame.
The TextFrame has its default dimensions (column widths are used to position the textframes).

Adding the text directly to the Table Cell should do the job.

You can set the Border of the Cell if you want to see a frame around the Cell.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: Bing [Bot], Google [Bot] and 25 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