Hi,
I'm using PDFSharp, WPF bulid in 1.32 version. I want to move from a basic Hello World - write text to pdf.
It's "my" code:
Code:
using System;
using System.Diagnostics;
using System.IO;
using PdfSharp;
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
// Draw the text
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
// Save the document...
const string filename = "HelloWorld.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);
}
}
}
In REFERENCES i include PDFsharp-WPF.dll and WindowsBase.dll.
In build i don't have errors but i trying run program i have problem:
{"Nie można załadować pliku lub zestawu (beginning English: Error FileNotFoundException) 'PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb' lub jednej z jego zależności. Nie można odnaleźć określonego pliku.":"PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb"}