C#读取一个WORD文档,然后转换成一张一张的JPG图片存储,这可如何是好?
可以在WINFORM里面,也可以在ASP.NET里面

解决方案 »

  1.   

    部署的机器上装着Word不? 程序启动Word文档然后截屏
      

  2.   

    http://www.pdf-convert.com/doc2img/
      

  3.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using Office = Microsoft.Office;
    using PowerPoint = Microsoft.Office.Interop.PowerPoint;
    using Word = Microsoft.Office.Interop.Word;
    using Excel;namespace OfficeToHTML
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent(); }
            private void ConvertWORD(string oFileName, string _HtmlFileName)
            {            object oMissing = System.Reflection.Missing.Value;
                object True = true;
                object False = false;
                object fmt = Word.WdSaveFormat.wdFormatHTML;
                object strHtml = _HtmlFileName;
                Word.Application WordApp = new Word.Application();
                Word._Document oDoc = null;
                WordApp = new Word.Application();
                WordApp.Visible = false;
                object fileName = oFileName;
                try
                {                oDoc =WordApp.Documents.Open(ref fileName,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);                oDoc.SaveAs(ref strHtml, ref fmt, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);                oDoc.Close(ref False, ref oMissing, ref oMissing);
                    WordApp.Quit(ref False, ref oMissing, ref oMissing);
                    GC.Collect();
                }            catch (Exception ex)
                {                display(ex.Message);
                    if (oDoc != null)
                    {
                        oDoc.Close(ref False, ref oMissing, ref oMissing);
                    }
                    WordApp.Quit(ref False, ref oMissing, ref oMissing);
                    GC.Collect();
                }
            }    }}需要安装office PIA 2003上面的是将Word转换成HTML,
    之后就到文件夹里找吧
      

  4.   

    听说可以用C++和DELPHI做莫非C#不行?囧
      

  5.   

    如果单用截屏应该不行。
    word文档很长的话,截屏就失去意义了。
      

  6.   

    可以分步骤来啊:
    第一:读取WORD文档(ASP.NET有这个功能,不过我没弄过  嘿嘿)
    第二:读出的文档写到图片上去(以前做过类似的功能:就是用户登录的验证码,我用的都是随机号码写到图片上去的)
    第三:考虑如果WORD文档很长  你这个怎么判断截取字符   然后再下一张图片上继续写(这个要看自己的程序了)