I need to convert a byte array generated from PDF into image and show it in the UI. I dnt want to store the image file anywhere in the disk.Conversion should be using in-built memory. I tried to convert byte into bitmap image using the following code. But image is not rendered in the UI.
using (MemoryStream ms = new MemoryStream(bytes, 0, bytes.Length))
BitmapImage im = new BitmapImage();
this.pdfImage.Source = im;
Is there anyother way to do this? Tools are also acceptable.
You can't convert a PDF into an image simply by converting it into a byte array. Without the conversion to an image, the BitmapImage identifies that it cannot display the byte array, so it doesn't attempt to display it. You might want to try this[^] library for the actual conversion (there's even a small sample on saving a PDF to a png file).
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
Even in asp .net i am unable to add the dlls. I have added libpdf dll and tried to run the code. I got the following error. Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found.
Last Visit: 31-Dec-99 18:00 Last Update: 20-Sep-14 10:26