views:

123

answers:

0

I put this content as Document in FlowDocumentReader.

FlowDocument flDoc = new FlowDocument();
flDoc.ColumnGap = 10;
flDoc.ColumnWidth = 130;
flDoc.TextAlignment = TextAlignment.Justify;
flDoc.IsOptimalParagraphEnabled = true;
flDoc.IsHyphenationEnabled = true;
flDoc.IsColumnWidthFlexible = true;

Paragraph par = new Paragraph();
par.Margin = new Thickness(0);
par.Padding = new Thickness(0);

Figure fig = new Figure();
fig.HorizontalAnchor = FigureHorizontalAnchor.PageLeft;
fig.VerticalAnchor = FigureVerticalAnchor.PageTop;
fig.Margin = new Thickness(0);
fig.Padding = new* Thickness(0);

Paragraph pp = new Paragraph();
pp.Margin = new Thickness(0);
pp.Padding = new Thickness(0);
pp.FontSize = 40;
pp.LineHeight = 40;
pp.TextAlignment = TextAlignment.Left;
pp.Inlines.Add(new Run("aaaaaaaaaaaaaaaaaaaaaaaaaaaa");
fig.Blocks.Add(pp);
par.Inlines.Add(fig);

flDoc.Blocks.Add(par);

Now we add next Block:

Paragraph p2 = new Paragraph();
p2.Margin = new Thickness(0);
p2.Padding = new Thickness(0);
p2.Inlines.Add(new Run("bbbbbbbbbbbbbbbbbbbbb"));
flDoc.Blocks.Add(p2);

Now there is added one empty line between "aaaaaaaaaaaaaaa" and next block "bbbbbbbbbbbb".

If I put this part of code instead of last one:

par.Inlines.Add(new Run("bbbbbbbbbbbbbbbbbbbbb"));
flDoc.Blocks.Add(par);

Everething looks fine. Empty line has dissapeared.

How can I get the same effect (without added empty line) putting new paragraph with new Block at he end of basic part of code?