title: Migradoc loses underline formatting before page break
body: <p>I have a small HTML-to-PDF which uses MigraDoc to produce PDF files. There seems to be a bug with adding formatted text to a paragraph. The problem is that underline formatting gets lost for all text on first page in a multipage PDF. Bold and Italic formatting stays preserved on all pages, but underline only shows starting from second page. Is it a known Migradoc bug?</p>
  
  <p>Just to avoid further questions here is my code:</p>
  
  <pre><code>var textFormat = this.BuildTextFormat(isBold, isItalic, isUnderline);
  var formattedText = paragraph.AddFormattedText(textFormat);
  formattedText.Add(new Text(text));
  
  
  private TextFormat BuildTextFormat(bool isBold, bool isItalic, bool isUnderline)
  {
      var textFormat = TextFormat.NoUnderline;
  
      if (isUnderline)
      {
          textFormat = TextFormat.Underline;
      }
  
      if (isBold)
      {
          textFormat |= TextFormat.Bold;
      }
  
      if (isItalic)
      {
          textFormat |= TextFormat.Italic;
      }
  
      return textFormat;
  }
  </code></pre>
  
  <p>UPDATE: </p>
  
  <p>Just to let PdfSharp devs know, that although I solved the issue but I still cannot understand whether it was an implementation or library bug, or both. The problem was solved by changing definition of styles, and more precisely, font colours. </p>
  
  <p>For the normal style we added a code similar to the following:</p>
  
  <pre><code>    var style = document.Styles["Normal"];
      style.Font.Color = Color.Parse("0x222222");
  </code></pre>
  
  <p>Then, other styles inherited from the normal style also could have fonts with different colours, also parsed from a Hexadecimal code. </p>
  
  <p>The final fix was tiny, just making change to each parsed colour like this:</p>
  
  <pre><code>style.Font.Color = Color.Parse("0xFF222222");
  </code></pre>
  
  <p>Another way to solve the bug was to create a CMYK colour. As a separate issue, when doing that I also noticed that colour parsed with the above line and the CMYK-generated colour are slightly different, so the colour parser also seems to be buggy. Here I assume that the HEX colour 0x222222 should be same as CMYK(0,0,0,86.7).</p>
  
  <p>The question is why the described fix solved the underline issue bug, and why the bug appeared only before page brake? Also, interestingly, when debugging this issue then I initially started to remove some pdf content and there was also a scenario when bug would disappear when certain tables were removed from the PDF document, which makes no sense to me. </p>
  
  <p>In any case, thank you for letting me know how to create an mdddl file. It was helpful as it allowed me to test few things.</p>