title: flowdocument - inserting rich text at end creating extra paragraph breaks above insertion point
body: <p>I am creating a flowdocument that consists of multiple records. Each record contains two tables at the top, and then some rich text that I'm pulling out of a database. The code that appends the rich text is found below (cp.Comments contains the rtf tagged text).</p>
  
  <pre><code>Dim tr As TextRange
  Dim arr() As Byte
  
  Using ms As New System.IO.MemoryStream
    arr = (New System.Text.UTF8Encoding).GetBytes(cp.Comments)
    ms.Write(arr, 0, arr.Length)
    ms.Seek(0, IO.SeekOrigin.Begin)
  
    tr = New TextRange(fd.ContentEnd, fd.ContentEnd)   'add to end
    tr.Load(ms, DataFormats.Rtf)
  End Using
  </code></pre>
  
  <p>The flowdocument renders the first of the records correctly, but all subsequent records are rendered with a break between the first and the second table.  What is the most odd is that I'm rendering the 2 tables <em>before</em> importing the RTF, but the RTF is somehow affecting the spacing between the tables anyway.</p>
  
  <pre><code>fd = new FlowDocument
  
  for each cp in SomeCollection
  
     fdtemp = New FlowDocument
  
     CreateFirstTable(cp, fdtemp)
     CreateSecondTable(cp, fdtemp)
     AddRTF(cp, fdtemp)
  
     FlowDocumentUtils.AddDocument(fdtemp, fd)
  
  next
  </code></pre>
  
  <p>The problem isn't something related to the data in the first element of the collection - if I tell the rendering to skip the rendering of the first record, then the second record renders ok, but the rest contain the extra spacing.</p>
  
  <p>Note: the problem is definitely related to the rich text insertion - if I comment out the AddRTF call, then all the tables are correctly rendered smashed together. (table margins are all set to (0,0,0,0))</p>
  
  <p>Has anyone ever seen this?</p>