PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:35 pm

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 Sep 28, 2017 11:49 am 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
Hi!
I need to add in table cell different paragraphs.
I try to use this variant but checkbox in second paragraph go out from cell.
Where is my mistakes?
Code:

field_2 = row.Cells[3].AddTextFrame();
            field_2.Width = "10 pt";
            field_2.Height = "6 pt";
            field_2.MarginRight = "1 pt";
            field_2.MarginBottom = "1 pt";
            field_2.WrapFormat.DistanceBottom = 0;
            field_2.WrapFormat.DistanceLeft = 0;
            field_2.WrapFormat.DistanceRight = 0;
            paragraph = field_2.AddParagraph("21");
            paragraph.Format.Font.Size = 5;
            paragraph = row.Cells[3].AddParagraph();
            paragraph.AddFormattedText("\u00fe", new Font("Wingdings"));
            paragraph.Format.Alignment = ParagraphAlignment.Right;
            paragraph.Format.Font.Size = 18;


Attachments:
cb.jpg
cb.jpg [ 4.04 KiB | Viewed 6863 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 28, 2017 3:31 pm 
Offline
PDFsharp Guru
User avatar

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

Do you set the height of the row in the code you are not showing?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 28, 2017 5:07 pm 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
Yes!
I set property RowHeight = Exactly
and set row height.
If i use only one paragraph (checkbox) it apeared correctly. But i need first paragraph (number 12) too.
May be add textframe to main section resolve this problem but if i want to move cell textframe on main section need to noved too. Not good idea imho.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 29, 2017 6:13 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Hi!
You have to set ".WrapFormat.Style = WrapStyle.Through;" for the TextFrame.
Textframe has many layout settings and I always have to play a bit until it works as wanted.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 29, 2017 8:58 am 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
Thank you very much!!! It works great!!


Attachments:
cb.jpg
cb.jpg [ 3.59 KiB | Viewed 6848 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 29, 2017 11:50 am 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
One more question - can i set padding in cell for paragraph if i need a litle shift for my text? Does migradoc have another way for position text in table cell?


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: No registered users and 147 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