views:

1161

answers:

2

I want to convert the contents of word file [3 or 4 page document] into JPEG file in C#.

I have tried using clipboard option, but it is converting only the first page. Please help me.

+1  A: 

i think that ghostscript can output jpeg

so the process would be:

  • first configure a postscript printer (print to file as the printer port)
  • print the msword document to a postscript file
  • process that file with GhostScript, you have many output options here

you can code the whole thing in C# here is a wrapper for ghostscript in c# ... and you could use COM interop to work with msword

this solution isn't the best for a public webserver though, as it would require msword to be installed

i have worked with excel before in this way (through COM interop on a webserver) to extract data ... but that was on an internal company webserver

ObeseCoder
Thanks for the reference to my project!
Matt Ephraim
A: 

You can use Aspose.Words for .NET.

Here are some articles how to render document pages into images:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/rendering-and-printing.html

romeok