PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

2 paragraph (or textframes in cell)
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3669
Page 1 of 1

Author:  pistoletov [ Thu Sep 28, 2017 11:49 am ]
Post subject:  2 paragraph (or textframes in cell)

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 6862 times ]

Author:  Thomas Hoevel [ Thu Sep 28, 2017 3:31 pm ]
Post subject:  Re: 2 paragraph (or textframes in cell)

Hi!

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

Author:  pistoletov [ Thu Sep 28, 2017 5:07 pm ]
Post subject:  Re: 2 paragraph (or textframes in cell)

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.

Author:  TH-Soft [ Fri Sep 29, 2017 6:13 am ]
Post subject:  Re: 2 paragraph (or textframes in cell)

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.

Author:  pistoletov [ Fri Sep 29, 2017 8:58 am ]
Post subject:  Re: 2 paragraph (or textframes in cell)

Thank you very much!!! It works great!!

Attachments:
cb.jpg
cb.jpg [ 3.59 KiB | Viewed 6847 times ]

Author:  pistoletov [ Fri Sep 29, 2017 11:50 am ]
Post subject:  Re: 2 paragraph (or textframes in cell)

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?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/