c# - Windows API Code Pack - ShellFile not generating PDF bitmap -


using code previous stack overflow questions:

system.drawing.bitmap image; shellfile f = shellfile.fromfilepath(filelocation); image = f.thumbnail.extralargebitmap; image.save(tempfile, imageformat.png); 

i trying use window api thumbnail of pdf

i led believe generates image file resembles first page of pdf document.

the reality not that, , merely looks pdf icon.

is there i'm missing required before works intended?

pdf files correctly associated adobe reader.

when browsing directories in windows explorer do see thumbnails associated documents.

i should note code in fact correctly extract thumbnails when dealing excel , word documents.

edit (references):

you need specify want thumbnail, not icon (the default). change code this:

system.drawing.bitmap image; shellfile f = shellfile.fromfilepath(filelocation);  //force actual thumbnail, not icon f.thumbnail.formatoption = shellthumbnailformatoption.thumbnailonly;  image = f.thumbnail.extralargebitmap; image.save(tempfile, imageformat.png); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -