Hi All,
I have just started playing with PDFsharp & MigraDoc and I have a problem referencing an image. This is a wpf project, and I have a folder "Images" under the root directory. Inside the Images folder I have a picture "mypic.jpg", with it is build action set to "Content", and the copy to output directory "copy always"
Root
___Images (folder)
______mypic.jpg
___Window1.xaml
This is the code:
Code:
static void CreateHeader()
{
// Put a logo in the header
Image image = section.Headers.Primary.AddImage("../Images/mypic.jpg");
image.Height = "0.5cm";
image.LockAspectRatio = true;
image.RelativeVertical = RelativeVertical.Line;
image.RelativeHorizontal = RelativeHorizontal.Margin;
image.Top = ShapePosition.Top;
image.Left = ShapePosition.Right;
image.WrapFormat.Style = WrapStyle.Through;
}
Any help will be greatly appreciate it.
Thanks