❶ 如何将word,excel,powerpoint等转换成html或pdf

Office文档转换为html网页文件或者PDF文件主要有以下几种方法:
PPT文件转换为PDF格式一般有以下几种版途径:
1.Office2007及更高的权版本支持直接将表格文件转存为html文件或PDF文件,打开文档,然后点击另存为,然后从格式列表中选择网页格式或者PDF格式即可。
2.使用第三方软件进行转换,比如anybizsoft pdf converter。添加幻灯片文件,然后选择转换后的格式(pdf),然后点击转换即可。
3.使用在线转换:网络搜索“pdf在线转换”,然后打开相应的连接,然后上传文档,点击转换,然后把转换后的文件下载到本地即可。

❷ word转html 出现的问题!文档名或路径无效!在线等!

嘻嘻。。没转过,只试过转TXT,自己直接改后缀。不懂html怎么改。

java程序调用 openoffice,将doc文件转Html文件,但转换完格式都变成居左边

1、到官网下载Jacob,
2、将压缩包解压后,Jacob.jar添加到Libraries中(先复制到项目目录中,右键单击jar包选择BuildPath—>AddtoBuildPath);
3、将Jacob.dll放至当前项目所用到的“jrein”下面(比如Eclipse正在用的Jre路径是C:Javajdk1.7.0_17jrein)。
Ps:按照上面的步骤配置的,基本没有问题,但是有些电脑可能还会报错,比如:java.lang.UnsatisfiedLinkError:nojacobinjava.library.path,这是系统没有加载到jacob.dll,网上解决方法是将Jacob.dll放至“WINDOWSSYSTEM32”下面。

Java代码
publicclassJacobUtil{
//8代表word保存成html
publicstaticfinalintWORD_HTML=8;
publicstaticvoidmain(String[]args){
Stringdocfile="C:\Users\无名\Desktop\xxx.doc";
Stringhtmlfile="C:\Users\无名\Desktop\xxx.html";
JacobUtil.wordToHtml(docfile,htmlfile);
}
/**
*WORD转HTML
*@paramdocfileWORD文件全路径
*@paramhtmlfile转换后HTML存放路径
*/
publicstaticvoidwordToHtml(Stringdocfile,Stringhtmlfile)
{
//启动word应用程序(MicrosoftOfficeWord2003)
ActiveXComponentapp=newActiveXComponent("Word.Application");
System.out.println("*****正在转换...*****");
try
{
//设置word应用程序不可见
app.setProperty("Visible",newVariant(false));
//documents表示word程序的所有文档窗口,(word是多文档应用程序)
Dispatchdocs=app.getProperty("Documents").toDispatch();
//打开要转换的word文件
Dispatchdoc=Dispatch.invoke(
docs,
"Open",
Dispatch.Method,
newObject[]{docfile,newVariant(false),
newVariant(true)},newint[1]).toDispatch();
//作为html格式保存到临时文件
Dispatch.invoke(doc,"SaveAs",Dispatch.Method,newObject[]{
htmlfile,newVariant(WORD_HTML)},newint[1]);
//关闭word文件
Dispatch.call(doc,"Close",newVariant(false));
}catch(Exceptione){
e.printStackTrace();
}finally{
//关闭word应用程序
app.invoke("Quit",newVariant[]{});
}
System.out.println("*****转换完毕********");
}
}

❹ word文档转成html格式不变,我之前是直接另存为.html格式的,但是文字全部是一行显示,格式不好看,急!

最好截图看下效果到底是什么样的

❺ C# word 转html 的问题

http://hi..com/%D5%DB%B6%CF%B5%C4%B3%E1%B0%F2_/blog/item/5ce9ca2f99dbcc39359bf7d6.html
你看看这个,我之前做这个是把word直接以“网络文库”那样的方式在html页面显示,希望对你有帮助

❻ 怎么样用ASP代码编写将WORD文件转换成HTML文件

'word文档转换成html格式
'**********************************************************
'
'调用方法:doc2htmlc:doc2htmlc:doc2html
'调用方法:doc2html-sc:doc2htmla.docc:doc2html
'
'**********************************************************

DimObjword
DimObjdoc
DimObjfso
DimStrsource
DimStrtarget
DimBbatch

'得到命令行参数,有三种可能的格式:[-s]要进行转换的源文件目录或文件转换成Html文件后保存的目录
FunctionGetparams()
DimObjarg
IfWscript.Arguments.Count>=2Then
IfWscript.Arguments.Item(0)="-s"OrWscript.Arguments.Item(0)="-S"Then
Strsource=Wscript.Arguments.Item(1)
Strtarget=Wscript.Arguments.Item(2)
Bbatch=False
Else
Strsource=Wscript.Arguments.Item(0)
Strtarget=Wscript.Arguments.Item(1)
Bbatch=True
EndIf
Else
Wscript.Quit(1)
EndIf
EndFunction

FunctionBatchprocessing()
DimObjfolder
DimObjfile
DimLpos
DimStrfilename
Lpos=0
SetObjfolder=Objfso.Getfolder(Strsource)
ForEachObjfileInObjfolder.Files
Lpos=Instr(1,Mid(Objfile.Path,Len(Objfile.Path)-3,4),"Doc",1)
IfLpos>0Then
Strfilename=Objfso.Getbasename(Objfile.Path)
WordinterfaceObjfile.Path,Strfilename
EndIf
Next
EndFunction

❼ 如何将word表格转换为html语言

可以用剪贴板使用复制和粘贴命令在excel和word的两个应用程序之间共享数据。由于它们回都支持对象的链接与嵌入(ole),答所以也可以用插入命令实现表格的交换。
将word表格插入excel工作表中
(1)启动word,选中在word中已经编辑好的表格,然后在“编辑”菜单中选“复制”命令。
(2)切换到excel,选中目的地,单击“编辑”菜单,执行“粘贴”命令。即可完成将word表格插入到当前excel工作表中。
1、在word中选中整个表格,按ctrl
c复制;
2、在excel中单击a1单元格,ctrl
v粘贴;
3、这时,表格默认也已经加上了边框,就可以跟excel
中建立的工作表一样进行计算了
假设你说的第一列是a列,第二列是b,第三列是c,每一
列的第一个数据都是在第一行,则在c1单元输入:"=a1*b1",回车后再鼠标拖动c1右下角的小黑点,拖到你想要的那一行为止

❽ c#怎么将word 转换成html文件

日常生活中,我们总是在Word中进行文字的编辑,它不仅能够保存Text文本,还可以保存文本的格式等等。那么如果我要将一Word文档上的内容展示在网页上,该怎么做呢?这里我提供了一个小工具,你可以将Word转换为Html,需要显示的话,可以直接访问该Html,废话不多说,下面看代码。
页面代码:

[html] view plain
<span style="font-size:18px;"><div>
<input id="File1" type="file" runat="server"/>
<asp:Button ID="btnConvert" runat="server" Text="转换" OnClick="btnConvert_Click" />
</div></span>
C#代码:

[csharp] view plain
<span style="font-size:18px;">using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

protected void Page_Load(object sender, EventArgs e)
{

}

/// <summary>
/// 将word转换为Html
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnConvert_Click(object sender, EventArgs e)
{
try
{

//上传
//uploadWord(File1);
//转换
wordToHtml(File1);
}
catch (Exception ex)
{
throw ex;
}
finally
{
Response.Write("恭喜,转换成功!");
}

}

//上传文件并转换为html wordToHtml(wordFilePath)
///<summary>
///上传文件并转存为html
///</summary>
///<param name="wordFilePath">word文档在客户机的位置</param>
///<returns>上传的html文件的地址</returns>
public string wordToHtml(System.Web.UI.HtmlControls.HtmlInputFile wordFilePath)
{
Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
Type wordType = word.GetType();
Microsoft.Office.Interop.Word.Documents docs = word.Documents;

// 打开文件
Type docsType = docs.GetType();

//应当先把文件上传至服务器然后再解析文件为html
string filePath = uploadWord(wordFilePath);

//判断是否上传文件成功
if (filePath == "0")
return "0";
//判断是否为word文件
if (filePath == "1")
return "1";

object fileName = filePath;

Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });

// 转换格式,另存为html
Type docType = doc.GetType();

string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();

// 判断指定目录下是否存在文件夹,如果不存在,则创建
if (!Directory.Exists(Server.MapPath("~\\html")))
{
// 创建up文件夹
Directory.CreateDirectory(Server.MapPath("~\\html"));
}

//被转换的html文档保存的位置
string ConfigPath = HttpContext.Current.Server.MapPath("html/" + filename + ".html");
object saveFileName = ConfigPath;

/*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成:
* docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
* null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
* 其它格式:
* wdFormatHTML
* wdFormatDocument
* wdFormatDOSText
* wdFormatDOSTextLineBreaks
* wdFormatEncodedText
* wdFormatRTF
* wdFormatTemplate
* wdFormatText
* wdFormatTextLineBreaks
* wdFormatUnicodeText
*/
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });

//关闭文档
docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { null, null, null });

// 退出 Word
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
//转到新生成的页面
return ("/" + filename + ".html");

}

public string uploadWord(System.Web.UI.HtmlControls.HtmlInputFile uploadFiles)
{
if (uploadFiles.PostedFile != null)
{
string fileName = uploadFiles.PostedFile.FileName;

int extendNameIndex = fileName.LastIndexOf(".");
string extendName = fileName.Substring(extendNameIndex);
string newName = "";
try
{
//验证是否为word格式
if (extendName == ".doc" || extendName == ".docx")
{

DateTime now = DateTime.Now;
newName = now.DayOfYear.ToString() + uploadFiles.PostedFile.ContentLength.ToString();

// 判断指定目录下是否存在文件夹,如果不存在,则创建
if (!Directory.Exists(Server.MapPath("~\\wordTmp")))
{
// 创建up文件夹
Directory.CreateDirectory(Server.MapPath("~\\wordTmp"));
}

//上传路径 指当前上传页面的同一级的目录下面的wordTmp路径
uploadFiles.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName));
}
else
{
return "1";
}
}
catch
{
return "0";
}
//return "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/wordTmp/" + newName + extendName;
return System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName);
}
else
{
return "0";
}
}</span>

❾ c#如何把word文档转成html

日常生活中,我们总是在Word中进行文字的编辑,它不仅能够保存Text文本,还可以保存文本的格式等等。那么如果我要将一Word文档上的内容展示在网页上,该怎么做呢?这里我提供了一个小工具,你可以将Word转换为Html,需要显示的话,可以直接访问该Html,废话不多说,下面看代码。
页面代码:

[html] view plain
<span style="font-size:18px;"><div>
<input id="File1" type="file" runat="server"/>
<asp:Button ID="btnConvert" runat="server" Text="转换" OnClick="btnConvert_Click" />
</div></span>
C#代码:

[csharp] view plain
<span style="font-size:18px;">using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

protected void Page_Load(object sender, EventArgs e)
{

}

/// <summary>
/// 将word转换为Html
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnConvert_Click(object sender, EventArgs e)
{
try
{

//上传
//uploadWord(File1);
//转换
wordToHtml(File1);
}
catch (Exception ex)
{
throw ex;
}
finally
{
Response.Write("恭喜,转换成功!");
}

}

//上传文件并转换为html wordToHtml(wordFilePath)
///<summary>
///上传文件并转存为html
///</summary>
///<param name="wordFilePath">word文档在客户机的位置</param>
///<returns>上传的html文件的地址</returns>
public string wordToHtml(System.Web.UI.HtmlControls.HtmlInputFile wordFilePath)
{
Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
Type wordType = word.GetType();
Microsoft.Office.Interop.Word.Documents docs = word.Documents;

// 打开文件
Type docsType = docs.GetType();

//应当先把文件上传至服务器然后再解析文件为html
string filePath = uploadWord(wordFilePath);

//判断是否上传文件成功
if (filePath == "0")
return "0";
//判断是否为word文件
if (filePath == "1")
return "1";

object fileName = filePath;

Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });

// 转换格式,另存为html
Type docType = doc.GetType();

string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();

// 判断指定目录下是否存在文件夹,如果不存在,则创建
if (!Directory.Exists(Server.MapPath("~\\html")))
{
// 创建up文件夹
Directory.CreateDirectory(Server.MapPath("~\\html"));
}

//被转换的html文档保存的位置
string ConfigPath = HttpContext.Current.Server.MapPath("html/" + filename + ".html");
object saveFileName = ConfigPath;

/*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成:
* docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
* null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
* 其它格式:
* wdFormatHTML
* wdFormatDocument
* wdFormatDOSText
* wdFormatDOSTextLineBreaks
* wdFormatEncodedText
* wdFormatRTF
* wdFormatTemplate
* wdFormatText
* wdFormatTextLineBreaks
* wdFormatUnicodeText
*/
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });

//关闭文档
docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { null, null, null });

// 退出 Word
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
//转到新生成的页面
return ("/" + filename + ".html");

}

public string uploadWord(System.Web.UI.HtmlControls.HtmlInputFile uploadFiles)
{
if (uploadFiles.PostedFile != null)
{
string fileName = uploadFiles.PostedFile.FileName;

int extendNameIndex = fileName.LastIndexOf(".");
string extendName = fileName.Substring(extendNameIndex);
string newName = "";
try
{
//验证是否为word格式
if (extendName == ".doc" || extendName == ".docx")
{

DateTime now = DateTime.Now;
newName = now.DayOfYear.ToString() + uploadFiles.PostedFile.ContentLength.ToString();

// 判断指定目录下是否存在文件夹,如果不存在,则创建
if (!Directory.Exists(Server.MapPath("~\\wordTmp")))
{
// 创建up文件夹
Directory.CreateDirectory(Server.MapPath("~\\wordTmp"));
}

//上传路径 指当前上传页面的同一级的目录下面的wordTmp路径
uploadFiles.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName));
}
else
{
return "1";
}
}
catch
{
return "0";
}
//return "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/wordTmp/" + newName + extendName;
return System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName);
}
else
{
return "0";
}
}</span>