How can I add a simple horizontal line in Migradoc so as to separate the content above the line from the content below the line?
Paragraph 1
Paragraph 2
Paragraph 3
ETC
Since the MigraDoc DOM is pretty basic, much of the conversion involves setting the Style of generated MigraDoc Paragraph instances. You can then configure these styles however you like. See the example project for more details. Import the MigraDoc.Extensions.Markdown namespace and call AddMarkdown on a MigraDoc Section instance:
The key is the HTML element you wish to handle and the value is a Func<HtmlNode, DocumentObject, DocumentObject. The DocumentObject instance passed to the handler is the parent object in the MigraDoc DOM, usually a Section or Paragraph (you may need to cater for both). The return value should be the DocumentObject that was created.
MigraDoc.Extensions makes use of MarkdownSharp to convert from Markdown to HTML and the Html Agility Pack to convert from HTML to PDF. Since the MigraDoc DOM is pretty basic, much of the conversion involves setting the Style of generated MigraDoc Paragraph instances.
You can add a border to a paragraph or a table.
With respect to your sample, you could add a bottom border to paragraph 2 or add a top border to paragraph 3 or add a new paragraph between them and set either top or bottom border.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With