In our application we include a background image to appear on every page:
Code:
var fixedPage = new FixedPage();
BitmapImage bgImage = new BitmapImage(new Uri("pack://application:,,,/Resources/Icons/bgimage.png"));
fixedPage.Background = new ImageBrush(bgImage);
The problem is that this image is not displayed in the exported PDF. This seems to be due to an exception that occurs when the following lines in PdfSharp.Pdf.Advanced.PdfImage are executed:
Code:
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(image.wpfImage));
encoder.Save(memory);
NotSupportedException occurred. "BitmapMetaData" is not available for "BitmapImage".
What can I do to make it work?