I'm evaluating PDFsharp as a replacement to our usage of Crystal Reports as the latter is simply too buggy and bloated. So far things are looking VERY good! I have some System.Drawing.Bitmap objects in my C# application that I'm converting to XImage objects and placing on a PdfPage object. This is working well. I'm using the following code to do the conversion: BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap( myBitmap.GetHbitmap(), System.IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
XImage newImage = XImage.FromBitmapSource(bitmapSource);
However looking at the help, documentation, and source code to PDFsharp I think I should be able to do this simply like this: XImage newImage = XImage.FromGdiPlusImage(myBitmap as Image);
The problem is FromGdiPlusImage does not appear as an available method for XImage. This is puzzling as I see it in the source code and the options GDI;UseGdiObjects are in fact defined in the solution when I build the resultant PdfSharp.dll which I'm referencing from my application.
I'm certainly doing something wrong?
Regards, Dick
|