Convert MS word file to Image in .Net C#
I want to convert Microsoft word into image file using .Net C#. als开发者_如何学Goo suggest any open source. Thanks for your help
Virtual printer drivers are a common way to do this.
You could use the MODI virtual printer included with office, to print to TIFF.
As PDF is the requirement there are a number of free virtual printers for PDF. Office 2010 has a 'save to PDF' feaure. It may also be worth looking at Open Office, it can open MS Office docs, and save to PDF. I'm not 100% sure what kind of API's it has available but it is open source
What you're asking for is a very complex problem to be solved there are commercial products that are designed to do this: Aspose.Total for .NET being of the larger names in this field.
For free or open source products that you can do this with, I'm not aware of any that will directly suit your need off hand.
Hmm yeah, in one hand it's complex problem in another it's not so complex. There are few ways you could go, before buying commercial stuff. On Idea level:
- Your app. will open that file in ms word in full screen mode, and construct an bitmap by making screen-shoots cropping borders and passing commands to show next page.
- Your app. will have ms word component (word object), do the same thing as before but capture just that component.
Other resources:
- PDF creation using C# (and Office) from RTF/DOC files
- Open Source PDF Libraries in C#
You can use a virtual printer and send a print command to ms word.
You can find sample c# codes from here http://www.pdfpilot.com/virtual-printer-howto-c-sharp.html
精彩评论