PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 21, 2024 4:49 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Aug 13, 2016 10:38 am 

Joined: Sat Aug 13, 2016 10:35 am
Posts: 2
Feel free to add to Wiki. I would have, but it wasn't public.

#I @"C:\git\welendus\packages\PdfSharp\lib\net20"
#r "PdfSharp.dll"

open PdfSharp.Pdf
open PdfSharp.Drawing

let filename = "HelloWorld3.pdf"

let generatePdf() =
    use document = new PdfDocument()
    document.Info.Title <- "Created with PDFsharp"
    let page1 = document.AddPage()
    let gfx1 = page1 |> XGraphics.FromPdfPage
    let font = XFont("Verdana", 20., XFontStyle.BoldItalic)

        "Hello, World!", font, XBrushes.Black,
        XRect(0., 0., page1.Width.Value, page1.Height.Value),

    document.Save filename

System.Diagnostics.Process.Start filename

Reply with quote  
PostPosted: Sat Aug 13, 2016 1:13 pm 
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
Thanks for the sample.
thorium wrote:
#I @"C:\git\welendus\packages\PdfSharp\lib\net20"
This line does not look "portable" and needs adjustments. It also needs some external downloads.

The MigraDoc sample uses "open" statements:

Ă–hmesh Volta ("() => true")
PDFsharp Team Holiday Substitute

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group