精华内容
下载资源
问答
  • Word转成HTML

    2018-04-18 10:00:43
    Word转成HTML,可支持03和07版,已封装为工具类,直接调用即可,jar包齐全
  • WORD转成html

    2011-01-22 21:47:46
    WORD转成html 把txt文件几docx文件转成html页面程序大家可以看看
  • word转换成html

    2015-10-22 11:08:12
    Word2HTML是一款可以把Word文档转换为HTML格式网页文件,生成类似微软MSDN在线帮助文档的软件。支持多个文档一次性合并转换,完美效果及个性设置,一分钟即可完成几百页文档的转换。Word2HTML!是您建立在线文档中心...
  • word转换成HTML

    2015-08-04 10:48:38
    利用appache poi将word文档转换成HTML便于前台预览,如果预览仅限于文字的话,这个完全能够满足,对于文档中包含表格,图片就不太适合了。jar包都有可以直接导入项目运行
  • word 转换 html

    2017-09-17 15:26:00
    // 作为html格式保存到临时文件::参数 new Variant(8)其中8表示word转html;7表示word转txt;44表示Excel转html。。。 Dispatch.invoke(doc2, "SaveAs", Dispatch.Method, new Object[] {outputFile, new ...

    https://zh.osdn.net/projects/sfnet_jacob-project/releases/#

    我已经下载

    在百度网盘

    http://pan.baidu.com/s/1dFEjDap

    152424_e8DY_240535.png 

     

    package com.yzc.word;
    
    import com.jacob.activeX.ActiveXComponent;
    import com.jacob.com.Dispatch;
    import com.jacob.com.Variant;
    
    public class WordReader {
    	 public static void extractDoc(String inputFIle, String outputFile) {
    	        boolean flag = false;
    	        // 打开Word应用程序
    	        ActiveXComponent app = new ActiveXComponent("Word.Application");
    	        try {
    	            // 设置word不可见
    	            app.setProperty("Visible", new Variant(false));
    	            // 打开word文件
    	            Dispatch doc1 = app.getProperty("Documents").toDispatch();
    	            Dispatch doc2 = Dispatch
    	                .invoke(doc1, "Open", Dispatch.Method, new Object[] {inputFIle, new Variant(false), new Variant(true)},
    	                        new int[1]).toDispatch();
    	            // 作为html格式保存到临时文件::参数 new Variant(8)其中8表示word转html;7表示word转txt;44表示Excel转html。。。
    	            Dispatch.invoke(doc2, "SaveAs", Dispatch.Method, new Object[] {outputFile, new Variant(8)}, new int[1]);
    	            // 关闭word
    	            Variant f = new Variant(false);
    	            Dispatch.call(doc2, "Close", f);
    	            flag = true;
    	        } catch (Exception e) {
    	            e.printStackTrace();
    	        } finally {
    	            app.invoke("Quit", new Variant[] {});
    	        }
    	        if (flag == true) {
    	            System.out.println("Transformed Successfully");
    	        } else {
    	            System.out.println("Transform Failed");
    	        }
    	    }
    }
    

     

    package com.yzc.word;
    
    public class TT {
    	public static void main(String[] args) {
            WordReader.extractDoc("e:/readme.docx","e:/readme.html");
        }
    }

     

    转载于:https://my.oschina.net/yizhichao/blog/1538682

    展开全文
  • Word 转成HTML

    2017-03-15 12:36:00
    2019独角兽企业重金招聘Python工程师标准>>> 来自CSDN的代码: ...http://devonios.com/word-convert-to-html.html 转载于:https://my.oschina.net/yangyan/blog/859438
    来自CSDN的代码:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    
    import org.apache.poi.xwpf.converter.core.FileImageExtractor;
    import org.apache.poi.xwpf.converter.core.FileURIResolver;
    import org.apache.poi.xwpf.converter.xhtml.XHTMLConverter;
    import org.apache.poi.xwpf.converter.xhtml.XHTMLOptions;
    import org.apache.poi.xwpf.usermodel.XWPFDocument;
    import org.apache.poi.xwpf.usermodel.XWPFPictureData;
    import org.junit.Assert;
    import org.junit.Test;
    
    public class word07toHtml {
    
    	@Test
    	public void canExtractImage() throws IOException {
    		File f = new File("d:/test/test.docx");
    		if (!f.exists()) {
    			System.out.println("Sorry File does not Exists!");
    		} else {
    			if (f.getName().endsWith(".docx") || f.getName().endsWith(".DOCX")) {
    				
    				// 1) Load DOCX into XWPFDocument
    				InputStream in = new FileInputStream(f);
    				XWPFDocument document = new XWPFDocument(in);
    
    				// 2) Prepare XHTML options (here we set the IURIResolver to
    				// load images from a "word/media" folder)
    				File imageFolderFile = new File("d:/test/media");
    				XHTMLOptions options = XHTMLOptions.create().URIResolver(
    						new FileURIResolver(imageFolderFile));
    				options.setExtractor(new FileImageExtractor(imageFolderFile));
    
    				// 3) Convert XWPFDocument to XHTML
    				OutputStream out = new FileOutputStream(new File(
    						"d:/test/test.htm"));
    				XHTMLConverter.getInstance().convert(document, out, options);
    			} else {
    				System.out.println("Enter only MS Office 2007+ files");
    			}
    		}
    	}
    }
     

    tips:

    本文由wp2Blog导入,原文链接:http://devonios.com/word-convert-to-html.html

    转载于:https://my.oschina.net/yangyan/blog/859438

    展开全文
  • Word转换成Html

    千次阅读 2012-12-28 01:55:43
    * word2003转Html * * @param fileName * @return * @throws FileNotFoundException * @throws IOException * @throws ParserConfigurationException * @throws TransformerException * @author ...
    package com.baiyang.lc.util;
    
    import java.io.ByteArrayOutputStream;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    
    import org.apache.poi.hwpf.HWPFDocumentCore;
    import org.apache.poi.hwpf.converter.WordToHtmlConverter;
    import org.apache.poi.hwpf.converter.WordToHtmlUtils;
    import org.w3c.dom.Document;
    
    public class Word {
    	/**
    	 * word2003转Html
    	 * 
    	 * @param fileName
    	 * @return
    	 * @throws FileNotFoundException
    	 * @throws IOException
    	 * @throws ParserConfigurationException
    	 * @throws TransformerException
    	 * @author baiyang
    	 */
    	public static String Word2003ToHtml(String fileName) throws FileNotFoundException, IOException, ParserConfigurationException, TransformerException {
    		WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
    		HWPFDocumentCore wordDocument = WordToHtmlUtils.loadDoc(new FileInputStream(fileName));
    		wordToHtmlConverter.processDocument(wordDocument);
    		Document htmlDocument = wordToHtmlConverter.getDocument();
    
    		ByteArrayOutputStream out = new ByteArrayOutputStream();
    		DOMSource domSource = new DOMSource(htmlDocument);
    		StreamResult streamResult = new StreamResult(out);
    
    		TransformerFactory tf = TransformerFactory.newInstance();
    		Transformer serializer = tf.newTransformer();
    		serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    		serializer.setOutputProperty(OutputKeys.INDENT, "yes");
    		serializer.setOutputProperty(OutputKeys.METHOD, "html");
    		serializer.transform(domSource, streamResult);
    
    		out.flush();
    		out.close();
    
    		String result = new String(out.toByteArray());
    		return result;
    	}
    }
    
    所需jar包
    展开全文
  • 利用POI将word转换成html实现在线阅读 利用POI将word转换成html实现在线阅读 利用POI将word转换成html实现在线阅读 利用POI将word转换成html实现在线阅读
  • java实现word转换成html实现word预览
  • word转成html

    2011-03-10 17:46:00
    /// word转成html /// </summary> /// <param name="wordFileName"></param> private string WordToHtml(object wordFileName) {  //在此处放置用户代码以初始化页面  Word.ApplicationClass word = new ...

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using System.Configuration;
    using System.Data; 
    using System.Web.Security; 
    using System.Web.UI.HtmlControls; 
    using System.Web.UI.WebControls.WebParts;
    using Word = Microsoft.Office.Interop.Word;
    using System.IO;

    namespace HtmlRegexImg
    {
        public partial class docTOhtml : System.Web.UI.Page
        {
           
     
        protected void Page_Load(object sender, EventArgs e)
        {
            WordToHtml(Server.MapPath("/DocFile/")+"test.doc");
     
                string content="";
                StreamReader st = new StreamReader(Server.MapPath("/DocFile/") + "test.html", System.Text.Encoding.Default);

                content = st.ReadToEnd();//内容追加到ss中
       

        }
    /// <summary>
    /// word转成html
    /// </summary>
    /// <param name="wordFileName"></param>
    private string WordToHtml(object wordFileName)
    {
          //在此处放置用户代码以初始化页面
            Word.ApplicationClass word = new Word.ApplicationClass();
            Type wordType = word.GetType();
            Word.Documents docs = word.Documents;
            //打开文件
            Type docsType = docs.GetType();
            Word.Document doc = (Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { wordFileName, true, true });
            //转换格式,另存为
            Type docType = doc.GetType();
            string wordSaveFileName = wordFileName.ToString();
            string strSaveFileName = wordSaveFileName.Substring(0, wordSaveFileName.Length - 3) + "html";
            object saveFileName = (object)strSaveFileName;
            docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML });
            docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod, null, doc, null);
            //退出 Word
            wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
            return saveFileName.ToString();
    }
    }
            }

     

    展开全文
  • word转换成html工具

    2012-11-03 11:39:22
    转换时请先备份WORD文件,转换时会把整个文件夹及子文件夹内的全部WORD转成HTM文件。 Word 转换成 Html Word 转换成 Html Word 转换成 Html 注意:转换时会删除原文件,一定要备份原文件 注意:转换时会删除...
  • js把word转成html

    2009-06-01 10:22:34
    js把word转成html js把word转成html js把word转成html js把word转成html
  • 不管是为了方便阅读、不会编写代码,还是什么其它原因,我的答案是:用为什么我会说迅捷PDF转换器可以把Word转换成HTML格式,那是因为在该软件的“PDF转换成其他文件”菜单中,里面的“文件HTML”,其中文件就包含...
  • 如何将wps转换成wordword转换wps?首先需将电脑设置为显示后缀名,然后将后缀名进行修改,或通过另存为方式实现转换。所需工具:word工具 wps工具将电脑设置显示后缀名将电脑设置显示后后缀名,方便查看转换...
  • 【实例简介】C#实现word转换成html文档【实例截图】【核心代码】using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using ...
  • word转换成HTML(C#)

    2008-12-12 18:25:37
    word转换成HTML(C#) word转换成HTML(C#) word转换成HTML(C#)
  • 将2003/2007版本word转成html进行浏览
  • WORD替换指定内容、WORD转成HTML主要片段代码 1、WORD按${key}格式指定替换内容 /** * 格式:${key} */ public static boolean replaceAndGenerateWord(String srcPath, String destPath, Map map) throws ...
  • word转换成html(poi)

    2019-08-17 16:40:18
    使用word转换成html常见问题:版本、图片无法显示问题。 版本 异常:(The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You ...
  • 如何将word转换成html

    2017-09-06 10:20:00
    很多小伙伴也许跟我一样在工作中遇到了'将word转换成html'的问题。 之前也有so过方法,说是什么word转存html文件,但是效果都有点差强人意。要是在项目中使用或者编辑的话也是不方便的。 这个样子也就是勉强能...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,708
精华内容 683
关键字:

word转成html