I am using the Microsoft API Code Pack and have a handler using the following code
string filename = "C:\Hello.pdf";
ShellFile shellFile = ShellFile.FromFilePath(filename);
Bitmap bitmap = shellFile.Thumbnail.ExtraLargeBitmap;
context.Response.ContentType = "image/jpeg";
bitmap.Save(context.Response.OutputStream, ImageFormat.Jpeg);
This works fine to produce a "preview" style thumbnail for pdf documents, but when I try it with Word or Excel I get the generic thumbnail for the filetype instead of a mini image of the document (which is what I'm looking for).
Anyone have ideas on this? Can it be done using this API?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…