Click here to Skip to main content
15,922,315 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hi,


i am trying to get the first page of a word document and save it as jpg image in an asp.net project using C#. does anybody know how to do it? please help me


Thanks,
Satya
Posted
Updated 20-Mar-11 21:25pm
v3

1 solution

Hi,

One way to do this is to use a printer driver that can print to jpeg. Then (via Interop) print the first page using such driver. One example is :http://sourceforge.net/projects/imageprinter/[^]

[Addition/Clarification]
- Download the driver from sourceforge (it's a setup for the driver)
- install it
- now write the proper code in C# where you (using interop)
- open the word document
- print the first page to using the printer driver installed
- close the document
 
Share this answer
 
v2
Comments
Member 7738154 23-Mar-11 1:34am    
can u please send me the code how to do?please.......
Wendelius 23-Mar-11 10:56am    
No, I won't do the coding for you but here's some good examples about interop:
- http://www.codeproject.com/KB/office/Word2007Automation.aspx
- http://www.codeproject.com/KB/office/ms_office_automation.aspx
- http://www.codeproject.com/KB/string/EasyRTF_To_HTML_.aspx

And if you encounter problems while coding feel free to post another question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900