Jun 4, 2011 at 10:55 AM
Edited Jun 4, 2011 at 2:40 PM
I want to display a logo on my PDF using SilverPDF 1.2.1269 and XImage.FromStream is the only none obsolete method, so I cannot use anything else.
My code to use an image is as follows:
FileStream file = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\RawoLogo.jpg",
int BitsLength = (int)file.Length;
byte Bits = new byte[BitsLength];
file.Read(Bits, 0, BitsLength);
XImage image = XImage.FromStream(file);
gfx.DrawImage(image, 200, 0);
When it gets to the line XImage image = XImage.FromStream(file) an error is generated. The file would be in a incorrect format.
I get this error no matter which image or which type of image I use.
I assume you had the same error and was able to fix this. If you have fixes this problem and if you have a DLL at hand that doesn't have this problem, could you be so kind as to email me the DLL that doesn't have this problem??
I could find a pdfImage.Merge with the line var t = other.Elements.getObject(key);, but I couldn't insert <PdfSharp.Pdf.PdfItem>, this resulted in an error.
Looking in the samples that come with the code. A relative URL is used to load a picture, however I am using an absolute URL and that doesn't work:
LogoFile = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
xImage = FromFile(LogoFile);
gfx.DrawImage(xImage, 200, 0);
i = System.Windows.Application.GetResourceStream(new
This results in an error expected relative URI but found absolute URI (and when I (as a test) add a picture to the project and try that as a relative URI than it cannot find the picture, probably because it is LightSwitch)
So no matter what I try I cannot get a picture in my PDF.
Is there a roadmap as to when a newer version of SilverPDF will come out?