3

How can I create thumbnails (an image of the first page of the document) of office documents in c#?

Alexis Pigeon
  • 7,223
  • 11
  • 38
  • 44
Luis
  • 2,608
  • 7
  • 42
  • 70

3 Answers3

3

Not sure if this helps but there's possibly a thread of information you can follow here..

See C# get thumbnail from file via windows api

Hope this helps!

Community
  • 1
  • 1
Julian Young
  • 882
  • 2
  • 9
  • 21
-1

2JPEG is a great solution for generating thumbnails. However, this only works in Microsoft Office files if you have Office installed in your computer. It will not work in a server.

Ivan Krsul
  • 51
  • 5
  • I don't have MS Office and it's generating proper images for doc and docx files anyway. – Bacco May 28 '21 at 16:46
-2

I'm evaluating 2JPEG and it appears to support 275 formats including Word, Excel, Publisher & Powerpoint files. fCoder recommends running 2JPEG as a scheduled background task. The command line syntax is pretty comprehensive.

Here's a sample snippet to generate a thumbnail for a specific file:

2jpeg.exe -src "c:\files\myfile.docx" -dst "c:\files" -oper Resize size:"100 200" fmode:fit_width -options pages:"1" scansf:no overwrite:yes template:"{Title}_thumb.jpg" silent:yes
James Moberg
  • 4,195
  • 1
  • 22
  • 20