0

Hi I have a FlowDocument in a WPF app.

When printing FlowDocument I need to add some white space at the end of the latest block added (BlockUIContainer)

At the moment I am using this code, but no space has been added and no errors.

Any idea how to do it? Any other better approach?

              flowDoc.Blocks.Add(new BlockUIContainer(imgVoucher));
                flowDoc.Blocks.Add(cntTxtSection);
                flowDoc.Blocks.Add(new BlockUIContainer(imgBarcode));
                flowDoc.Blocks.Add(new Paragraph(new LineBreak()));
                flowDoc.Blocks.Add(new Paragraph(new LineBreak()));
                flowDoc.Blocks.Add(new Paragraph(new LineBreak()));
                flowDoc.Blocks.Add(new Paragraph(new LineBreak()));
Stephan Bauer
  • 9,120
  • 5
  • 36
  • 58
GibboK
  • 71,848
  • 143
  • 435
  • 658
  • 1
    Probably a silly comment but if you don't have anything after the LineBreak how do you know space was not added? – paparazzo Jan 14 '14 at 15:39

1 Answers1

0

I don't know a great deal about Flow Documents however from a quick Google search you can add margins to a block..

http://msdn.microsoft.com/en-us/library/system.windows.documents.block.margin%28v=vs.110%29.aspx

Margin looks like this: (Left, Top, Right, Bottom)

Margin="0,0,0,10"

A margin better fits your requirement than adding multiple line breaks which is semantically incorrect.

BenjaminPaul
  • 2,931
  • 19
  • 18