请教一下,我现在想实现一个将office文件转换成图片的功能,能不能用代码实现。分数不够可在加!  在线急等

解决方案 »

  1.   

    1、找一个免费的虚拟打印机,能把doc打成图片的。
    2、在服务器上装office,和虚拟打印机。设置office中的默认打印机为此虚拟打印机。
    3、在c#里调word打开doc文档,打印。
    4、访问打出来的图片。具体细节自己百度吧,我的刻盘放家了。
      

  2.   

    萬能轉換http://www.sautinsoft.com/
      

  3.   

    追加回复下,我找到了我用的虚拟打印机。
    bullizip
    免费的
    office2003下我用的。
    相关的虚拟打印机是支持直接com调用的,其官网提供了在线的用户手册,你要是想再了解一下,自己上网一下吧。支持打印成pdf,也支持水印的。非常方便的一个小软件。关于它的免费协议由于我是在内部小系统用,没商用,所以没仔细看,你要发布的话请自己查清楚。            Microsoft.Office.Interop.Word.Application theWordApp = null;
                Microsoft.Office.Interop.Word.Document theDoc = null;            object falseValue = false;
                object trueValue = true;
                object nothingStr = "";
                object missing = System.Reflection.Missing.Value;
                object fileName = @"C:\a.doc ";
                object Background = true;
                object Range = Microsoft.Office.Interop.Word.WdPrintOutRange.wdPrintAllDocument;
                object Copies = 1;
                object PageType = Microsoft.Office.Interop.Word.WdPrintOutPages.wdPrintAllPages;
                object PrintToFile = false;
                object Collate = false;
                object ActivePrinterMacGX = missing;
                object ManualDuplexPrint = false;
                object PrintZoomColumn = 1;
                object PrintZoomRow = 1;
                string PrintfileName = @"C:\aaaaaaa_<pageno>.jpg ";            theWordApp = new Microsoft.Office.Interop.Word.Application();
                theWordApp.Visible = false;
                theDoc = theWordApp.Documents.Open(ref fileName, ref missing, ref falseValue, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
                theDoc.Activate();
                Bullzip.PDFPrinterSettings theSetting = new Bullzip.PDFPrinterSettings();            theSetting.SetValue("Output", PrintfileName);
                theSetting.SetValue("Device", "jpeg");
                theSetting.SetValue("ShowSettings", "never");            theSetting.WriteSettings(true);
                theWordApp.PrintOut(ref Background, ref falseValue, ref Range, ref missing,
                    ref missing, ref missing, ref missing, ref Copies,
                    ref missing, ref PageType, ref PrintToFile, ref Collate, ref missing,
                    ref ActivePrinterMacGX, ref ManualDuplexPrint, ref PrintZoomColumn,
                    ref PrintZoomRow, ref missing, ref missing);
                Console.ReadLine();
                theWordApp.Application.Quit(ref falseValue, ref missing, ref missing);
                theDoc = null;
                theWordApp = null;
                Console.ReadLine();