Hi, in my WPF application, there is a list of PDF documents. There is a FileSystemWatcher looking for new PDF documents appearing in a directory. When a new PDF file appears, a I generate a thumbnail and add a new item to the list. The problem is that I
cannot make the image display the thumbnail. I tried two approaches:
1. I use QuickPDFLibrary to extract a page as image and to save it to a file in PNG format. Then I read create a BitmapSource object that is returned from the method. It is set afterwards as the source of the list item's image.
public BitmapSource preview(int pageNumber)
BitmapFrame bitmapSource = null;
string thumbnailFile = Environment.GetEnvironmentVariable("TEMP") + "\\" + documentHandle.ToString() + ".png";
FileStream fileStream = null;
// save the page as a PNG to the thumbnailFile
// At this point, the image is saved in the file. When I open it, it looks fine.
View Complete Post