Out of curiosity I tried MigraDoc with F#.
I'm an F# noob. The sample may not comply to all F# best practices.
See the C# sample for further information about the MigraDoc routines in use:
http://pdfsharp.net/wiki/MigraDocHelloWorld-sample.ashxCode:
open MigraDoc.DocumentObjectModel
open MigraDoc.Rendering
open System.Diagnostics
let HelloWorld =
let document = Document()
let section = document.AddSection()
let paragraph = section.AddParagraph("Hello, World!")
ignore(section.AddParagraph("Hello, World!"))
paragraph.Format.Font.Bold <- true // Makes the first line bold.
let renderer = PdfDocumentRenderer(true)
renderer.Document <- document
renderer.RenderDocument()
renderer.PdfDocument.Save("HelloWorld.pdf")
ignore(Process.Start("HelloWorld.pdf"))
0 // return an integer exit code
[<EntryPoint>]
let main argv =
HelloWorld