- 浏览: 575492 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (365)
- Tomcat调优 (2)
- Apache Http (20)
- Webserver安装 (5)
- Linux安装 (28)
- Linux常用命令 (17)
- C语言及网络编程 (10)
- 文件系统 (0)
- Lucene (12)
- Hadoop (9)
- FastDFS (8)
- 报表 (0)
- 性能测试 (1)
- JAVA (18)
- CSharp (3)
- C++ (38)
- BI (0)
- 数据挖掘 (0)
- 数据采集 (0)
- 网址收集整理 (3)
- Resin (0)
- JBoss (0)
- nginx (0)
- 数据结构 (1)
- 随记 (5)
- Katta (1)
- Shell (6)
- webservice (0)
- JBPM (2)
- JQuery (6)
- Flex (41)
- SSH (0)
- javascript (7)
- php (13)
- 数据库 (6)
- 搜索引擎排序 (2)
- LVS (3)
- solr (2)
- windows (1)
- mysql (3)
- 营销软件 (1)
- tfs (1)
- memcache (5)
- 分布式搜索 (3)
- 关注的博客 (1)
- Android (2)
- clucene (11)
- 综合 (1)
- c c++ 多线程 (6)
- Linux (1)
- 注册码 (1)
- 文件类型转换 (3)
- Linux 与 asp.net (2)
- perl (5)
- coreseek (1)
- 阅读器 (2)
- SEO (1)
- 励志 (1)
- 在线性能测试工具 (1)
- yii (7)
- 服务器监控 (1)
- 广告 (1)
- 代理服务 (5)
- zookeeper (8)
- 广告联盟 (0)
- 常用软件下载 (1)
- 架设自已的站点心得 (0)
最新评论
-
terry07:
java 7 用这个就可以了 Desktop desktop ...
关于java Runtime.getRunTime.exec(String command)的使用 -
HSINKING:
怎么设置打开的dos 窗口是指定的路径下
关于java调用bat文件,不打开窗口 -
liubang201010:
hyperic hq更多参考资料,请访问:http://www ...
hyperic-hq -
^=^:
STDIN_FILENO是unistd.h中定义的一个numb ...
深入理解dup和dup2的用法 -
antor:
留个记号,学习了
[转]用java流方式判断文件类型
from http://www.iteye.com/topic/333676
项目开发过程中,需求涉及到了各种文档转换为HTML或者网页易显示格式,现在将实现方式整理如下:
一、使用Jacob转换Word,Excel为HTML
“JACOB一个Java-COM中间件.通过这个组件你可以在Java应用程序中调用COM组件和Win32 libraries。”
首先下载Jacob包,JDK1.5以上需要使用Jacob1.9版本(JDK1.6尚未测试),与先前的Jacob1.7差别不大
1、将压缩包解压后,Jacob.jar添加到Libraries中;
2、将Jacob.dll放至“WINDOWS\SYSTEM32”下面。
需要注意的是:
【使用IDE启动Web服务器时,系统读取不到Jacob.dll,例如用MyEclipse启动Tomcat,就需要将dll文件copy到MyEclipse安装目录的“jre\bin”下面。
一般系统没有加载到Jacob.dll文件时,报错信息为:“java.lang.UnsatisfiedLinkError: no jacob in java.library.path”】
新建类:
Java代码
1.public class JacobUtil
2.{
3. public static final int WORD_HTML = 8;
4.
5. public static final int WORD_TXT = 7;
6.
7. public static final int EXCEL_HTML = 44;
8.
9. /**
10. * WORD转HTML
11. * @param docfile WORD文件全路径
12. * @param htmlfile 转换后HTML存放路径
13. */
14. public static void wordToHtml(String docfile, String htmlfile)
15. {
16. ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word
17. try
18. {
19. app.setProperty("Visible", new Variant(false));
20. Dispatch docs = app.getProperty("Documents").toDispatch();
21. Dispatch doc = Dispatch.invoke(
22. docs,
23. "Open",
24. Dispatch.Method,
25. new Object[] { docfile, new Variant(false),
26. new Variant(true) }, new int[1]).toDispatch();
27. Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {
28. htmlfile, new Variant(WORD_HTML) }, new int[1]);
29. Variant f = new Variant(false);
30. Dispatch.call(doc, "Close", f);
31. }
32. catch (Exception e)
33. {
34. e.printStackTrace();
35. }
36. finally
37. {
38. app.invoke("Quit", new Variant[] {});
39. }
40. }
41.
42. /**
43. * EXCEL转HTML
44. * @param xlsfile EXCEL文件全路径
45. * @param htmlfile 转换后HTML存放路径
46. */
47. public static void excelToHtml(String xlsfile, String htmlfile)
48. {
49. ActiveXComponent app = new ActiveXComponent("Excel.Application"); // 启动word
50. try
51. {
52. app.setProperty("Visible", new Variant(false));
53. Dispatch excels = app.getProperty("Workbooks").toDispatch();
54. Dispatch excel = Dispatch.invoke(
55. excels,
56. "Open",
57. Dispatch.Method,
58. new Object[] { xlsfile, new Variant(false),
59. new Variant(true) }, new int[1]).toDispatch();
60. Dispatch.invoke(excel, "SaveAs", Dispatch.Method, new Object[] {
61. htmlfile, new Variant(EXCEL_HTML) }, new int[1]);
62. Variant f = new Variant(false);
63. Dispatch.call(excel, "Close", f);
64. }
65. catch (Exception e)
66. {
67. e.printStackTrace();
68. }
69. finally
70. {
71. app.invoke("Quit", new Variant[] {});
72. }
73. }
74.
75.}
public class JacobUtil
{
public static final int WORD_HTML = 8;
public static final int WORD_TXT = 7;
public static final int EXCEL_HTML = 44;
/**
* WORD转HTML
* @param docfile WORD文件全路径
* @param htmlfile 转换后HTML存放路径
*/
public static void wordToHtml(String docfile, String htmlfile)
{
ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word
try
{
app.setProperty("Visible", new Variant(false));
Dispatch docs = app.getProperty("Documents").toDispatch();
Dispatch doc = Dispatch.invoke(
docs,
"Open",
Dispatch.Method,
new Object[] { docfile, new Variant(false),
new Variant(true) }, new int[1]).toDispatch();
Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {
htmlfile, new Variant(WORD_HTML) }, new int[1]);
Variant f = new Variant(false);
Dispatch.call(doc, "Close", f);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
app.invoke("Quit", new Variant[] {});
}
}
/**
* EXCEL转HTML
* @param xlsfile EXCEL文件全路径
* @param htmlfile 转换后HTML存放路径
*/
public static void excelToHtml(String xlsfile, String htmlfile)
{
ActiveXComponent app = new ActiveXComponent("Excel.Application"); // 启动word
try
{
app.setProperty("Visible", new Variant(false));
Dispatch excels = app.getProperty("Workbooks").toDispatch();
Dispatch excel = Dispatch.invoke(
excels,
"Open",
Dispatch.Method,
new Object[] { xlsfile, new Variant(false),
new Variant(true) }, new int[1]).toDispatch();
Dispatch.invoke(excel, "SaveAs", Dispatch.Method, new Object[] {
htmlfile, new Variant(EXCEL_HTML) }, new int[1]);
Variant f = new Variant(false);
Dispatch.call(excel, "Close", f);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
app.invoke("Quit", new Variant[] {});
}
}
}当时我在找转换控件时,发现网易也转载了一偏关于Jacob使用帮助,但其中出现了比较严重的错误:String htmlfile = "C:\\AA";
只指定到了文件夹一级,正确写法是String htmlfile = "C:\\AA\\xxx.html";
到此WORD/EXCEL转换HTML就已经差不多了,相信大家应该很清楚了:)
二、使用XPDF将PDF转换为HTML
1、下载xpdf最新版本,地址:http://www.foolabs.com/xpdf/download.html
我下载的是xpdf-3.02pl2-win32.zip
2、下载中文支持包
我下载的是xpdf-chinese-simplified.tar.gz
3、下载pdftohtml支持包
地址:http://sourceforge.net/projects/pdftohtml/
我下载的是:pdftohtml-0.39-win32.tar.gz
4、解压调试
1) 先将xpdf-3.02pl2-win32.zip解压,解压后的内容可根据需要进行删减,如果只需要转换为txt格式,其他的exe文件可以删除,只保留pdftotext.exe,以此类推;
2) 然后将xpdf-chinese-simplified.tar.gz解压到刚才xpdf-3.02pl2-win32.zip的解压目录;
3) 将pdftohtml-0.39-win32.tar.gz解压,pdftohtml.exe解压到xpdf-3.02pl2-win32.zip的解压目录;
4) 目录结构:
+---[X:\xpdf]
|-------各种转换用到的exe文件
|
|-------xpdfrc
|
+------[X:\xpdf\xpdf-chinese-simplified]
|
|
+-------很多转换时需要用到的字符文件
xpdfrc:此文件是用来声明转换字符集对应路径的文件
5) 修改xpdfrc文件(文件原名为sample-xpdfrc)
修改文件内容为:
Txt代码
1.#----- begin Chinese Simplified support package
2.cidToUnicode Adobe-GB1 xpdf-chinese-simplified\Adobe-GB1.cidToUnicode
3.unicodeMap ISO-2022-CN xpdf-chinese-simplified\ISO-2022-CN.unicodeMap
4.unicodeMap EUC-CN xpdf-chinese-simplified\EUC-CN.unicodeMap
5.unicodeMap GBK xpdf-chinese-simplified\GBK.unicodeMap
6.cMapDir Adobe-GB1 xpdf-chinese-simplified\CMap
7.toUnicodeDir xpdf-chinese-simplified\CMap
8.fontDir C:\WINDOWS\Fonts
9.displayCIDFontTT Adobe-GB1 C:\WINDOWS\Fonts\simhei.ttf
10.#----- end Chinese Simplified support package
#----- begin Chinese Simplified support package
cidToUnicode Adobe-GB1 xpdf-chinese-simplified\Adobe-GB1.cidToUnicode
unicodeMap ISO-2022-CN xpdf-chinese-simplified\ISO-2022-CN.unicodeMap
unicodeMap EUC-CN xpdf-chinese-simplified\EUC-CN.unicodeMap
unicodeMap GBK xpdf-chinese-simplified\GBK.unicodeMap
cMapDir Adobe-GB1 xpdf-chinese-simplified\CMap
toUnicodeDir xpdf-chinese-simplified\CMap
fontDir C:\WINDOWS\Fonts
displayCIDFontTT Adobe-GB1 C:\WINDOWS\Fonts\simhei.ttf
#----- end Chinese Simplified support package
6) 创建bat文件pdftohtml.bat(放置的路径不能包含空格)
内容为:
Txt代码
1.@echo off
2.set folderPath=%1
3.set filePath=%2
4.cd /d %folderPath%
5.pdftohtml -enc GBK %filePath%
6.exit
@echo off
set folderPath=%1
set filePath=%2
cd /d %folderPath%
pdftohtml -enc GBK %filePath%
exit
7) 创建类
Java代码
1.public class ConvertPdf
2.{
3. private static String INPUT_PATH;
4. private static String PROJECT_PATH;
5.
6. public static void convertToHtml(String file, String project)
7. {
8. INPUT_PATH = file;
9. PROJECT_PATH = project;
10. if(checkContentType()==0)
11. {
12. toHtml();
13. }
14. }
15.
16. private static int checkContentType()
17. {
18. String type = INPUT_PATH.substring(INPUT_PATH.lastIndexOf(".") + 1, INPUT_PATH.length())
19. .toLowerCase();
20. if (type.equals("pdf"))
21. return 0;
22. else
23. return 9;
24. }
25.
26. private static void toHtml()
27. {
28. if(new File(INPUT_PATH).isFile())
29. {
30. try
31. {
32. String cmd = "cmd /c start X:\\pdftohtml.bat \"" + PROJECT_PATH + "\" \"" + INPUT_PATH + "\"";
33. Runtime.getRuntime().exec(cmd);
34. }
35. catch (IOException e)
36. {
37. e.printStackTrace();
38. }
39. }
40. }
41.
42.}
public class ConvertPdf
{
private static String INPUT_PATH;
private static String PROJECT_PATH;
public static void convertToHtml(String file, String project)
{
INPUT_PATH = file;
PROJECT_PATH = project;
if(checkContentType()==0)
{
toHtml();
}
}
private static int checkContentType()
{
String type = INPUT_PATH.substring(INPUT_PATH.lastIndexOf(".") + 1, INPUT_PATH.length())
.toLowerCase();
if (type.equals("pdf"))
return 0;
else
return 9;
}
private static void toHtml()
{
if(new File(INPUT_PATH).isFile())
{
try
{
String cmd = "cmd /c start X:\\pdftohtml.bat \"" + PROJECT_PATH + "\" \"" + INPUT_PATH + "\"";
Runtime.getRuntime().exec(cmd);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}String cmd = "....";此处代码是调用创建的bat文件进行转换
8) 测试转换
Java代码
1.public static void main(String[] args)
2.{
3. ConvertPdf.convertToHtml("C:\\test.pdf", "X:\\xpdf");
4.}
public static void main(String[] args)
{
ConvertPdf.convertToHtml("C:\\test.pdf", "X:\\xpdf");
}
以上就是整理的内容,后续还会添加视频转换为FLV格式,如果需要的话:)
说的不是很详细,碰到问题的朋友可以自己努力解决一下:)
项目开发过程中,需求涉及到了各种文档转换为HTML或者网页易显示格式,现在将实现方式整理如下:
一、使用Jacob转换Word,Excel为HTML
“JACOB一个Java-COM中间件.通过这个组件你可以在Java应用程序中调用COM组件和Win32 libraries。”
首先下载Jacob包,JDK1.5以上需要使用Jacob1.9版本(JDK1.6尚未测试),与先前的Jacob1.7差别不大
1、将压缩包解压后,Jacob.jar添加到Libraries中;
2、将Jacob.dll放至“WINDOWS\SYSTEM32”下面。
需要注意的是:
【使用IDE启动Web服务器时,系统读取不到Jacob.dll,例如用MyEclipse启动Tomcat,就需要将dll文件copy到MyEclipse安装目录的“jre\bin”下面。
一般系统没有加载到Jacob.dll文件时,报错信息为:“java.lang.UnsatisfiedLinkError: no jacob in java.library.path”】
新建类:
Java代码
1.public class JacobUtil
2.{
3. public static final int WORD_HTML = 8;
4.
5. public static final int WORD_TXT = 7;
6.
7. public static final int EXCEL_HTML = 44;
8.
9. /**
10. * WORD转HTML
11. * @param docfile WORD文件全路径
12. * @param htmlfile 转换后HTML存放路径
13. */
14. public static void wordToHtml(String docfile, String htmlfile)
15. {
16. ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word
17. try
18. {
19. app.setProperty("Visible", new Variant(false));
20. Dispatch docs = app.getProperty("Documents").toDispatch();
21. Dispatch doc = Dispatch.invoke(
22. docs,
23. "Open",
24. Dispatch.Method,
25. new Object[] { docfile, new Variant(false),
26. new Variant(true) }, new int[1]).toDispatch();
27. Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {
28. htmlfile, new Variant(WORD_HTML) }, new int[1]);
29. Variant f = new Variant(false);
30. Dispatch.call(doc, "Close", f);
31. }
32. catch (Exception e)
33. {
34. e.printStackTrace();
35. }
36. finally
37. {
38. app.invoke("Quit", new Variant[] {});
39. }
40. }
41.
42. /**
43. * EXCEL转HTML
44. * @param xlsfile EXCEL文件全路径
45. * @param htmlfile 转换后HTML存放路径
46. */
47. public static void excelToHtml(String xlsfile, String htmlfile)
48. {
49. ActiveXComponent app = new ActiveXComponent("Excel.Application"); // 启动word
50. try
51. {
52. app.setProperty("Visible", new Variant(false));
53. Dispatch excels = app.getProperty("Workbooks").toDispatch();
54. Dispatch excel = Dispatch.invoke(
55. excels,
56. "Open",
57. Dispatch.Method,
58. new Object[] { xlsfile, new Variant(false),
59. new Variant(true) }, new int[1]).toDispatch();
60. Dispatch.invoke(excel, "SaveAs", Dispatch.Method, new Object[] {
61. htmlfile, new Variant(EXCEL_HTML) }, new int[1]);
62. Variant f = new Variant(false);
63. Dispatch.call(excel, "Close", f);
64. }
65. catch (Exception e)
66. {
67. e.printStackTrace();
68. }
69. finally
70. {
71. app.invoke("Quit", new Variant[] {});
72. }
73. }
74.
75.}
public class JacobUtil
{
public static final int WORD_HTML = 8;
public static final int WORD_TXT = 7;
public static final int EXCEL_HTML = 44;
/**
* WORD转HTML
* @param docfile WORD文件全路径
* @param htmlfile 转换后HTML存放路径
*/
public static void wordToHtml(String docfile, String htmlfile)
{
ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word
try
{
app.setProperty("Visible", new Variant(false));
Dispatch docs = app.getProperty("Documents").toDispatch();
Dispatch doc = Dispatch.invoke(
docs,
"Open",
Dispatch.Method,
new Object[] { docfile, new Variant(false),
new Variant(true) }, new int[1]).toDispatch();
Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {
htmlfile, new Variant(WORD_HTML) }, new int[1]);
Variant f = new Variant(false);
Dispatch.call(doc, "Close", f);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
app.invoke("Quit", new Variant[] {});
}
}
/**
* EXCEL转HTML
* @param xlsfile EXCEL文件全路径
* @param htmlfile 转换后HTML存放路径
*/
public static void excelToHtml(String xlsfile, String htmlfile)
{
ActiveXComponent app = new ActiveXComponent("Excel.Application"); // 启动word
try
{
app.setProperty("Visible", new Variant(false));
Dispatch excels = app.getProperty("Workbooks").toDispatch();
Dispatch excel = Dispatch.invoke(
excels,
"Open",
Dispatch.Method,
new Object[] { xlsfile, new Variant(false),
new Variant(true) }, new int[1]).toDispatch();
Dispatch.invoke(excel, "SaveAs", Dispatch.Method, new Object[] {
htmlfile, new Variant(EXCEL_HTML) }, new int[1]);
Variant f = new Variant(false);
Dispatch.call(excel, "Close", f);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
app.invoke("Quit", new Variant[] {});
}
}
}当时我在找转换控件时,发现网易也转载了一偏关于Jacob使用帮助,但其中出现了比较严重的错误:String htmlfile = "C:\\AA";
只指定到了文件夹一级,正确写法是String htmlfile = "C:\\AA\\xxx.html";
到此WORD/EXCEL转换HTML就已经差不多了,相信大家应该很清楚了:)
二、使用XPDF将PDF转换为HTML
1、下载xpdf最新版本,地址:http://www.foolabs.com/xpdf/download.html
我下载的是xpdf-3.02pl2-win32.zip
2、下载中文支持包
我下载的是xpdf-chinese-simplified.tar.gz
3、下载pdftohtml支持包
地址:http://sourceforge.net/projects/pdftohtml/
我下载的是:pdftohtml-0.39-win32.tar.gz
4、解压调试
1) 先将xpdf-3.02pl2-win32.zip解压,解压后的内容可根据需要进行删减,如果只需要转换为txt格式,其他的exe文件可以删除,只保留pdftotext.exe,以此类推;
2) 然后将xpdf-chinese-simplified.tar.gz解压到刚才xpdf-3.02pl2-win32.zip的解压目录;
3) 将pdftohtml-0.39-win32.tar.gz解压,pdftohtml.exe解压到xpdf-3.02pl2-win32.zip的解压目录;
4) 目录结构:
+---[X:\xpdf]
|-------各种转换用到的exe文件
|
|-------xpdfrc
|
+------[X:\xpdf\xpdf-chinese-simplified]
|
|
+-------很多转换时需要用到的字符文件
xpdfrc:此文件是用来声明转换字符集对应路径的文件
5) 修改xpdfrc文件(文件原名为sample-xpdfrc)
修改文件内容为:
Txt代码
1.#----- begin Chinese Simplified support package
2.cidToUnicode Adobe-GB1 xpdf-chinese-simplified\Adobe-GB1.cidToUnicode
3.unicodeMap ISO-2022-CN xpdf-chinese-simplified\ISO-2022-CN.unicodeMap
4.unicodeMap EUC-CN xpdf-chinese-simplified\EUC-CN.unicodeMap
5.unicodeMap GBK xpdf-chinese-simplified\GBK.unicodeMap
6.cMapDir Adobe-GB1 xpdf-chinese-simplified\CMap
7.toUnicodeDir xpdf-chinese-simplified\CMap
8.fontDir C:\WINDOWS\Fonts
9.displayCIDFontTT Adobe-GB1 C:\WINDOWS\Fonts\simhei.ttf
10.#----- end Chinese Simplified support package
#----- begin Chinese Simplified support package
cidToUnicode Adobe-GB1 xpdf-chinese-simplified\Adobe-GB1.cidToUnicode
unicodeMap ISO-2022-CN xpdf-chinese-simplified\ISO-2022-CN.unicodeMap
unicodeMap EUC-CN xpdf-chinese-simplified\EUC-CN.unicodeMap
unicodeMap GBK xpdf-chinese-simplified\GBK.unicodeMap
cMapDir Adobe-GB1 xpdf-chinese-simplified\CMap
toUnicodeDir xpdf-chinese-simplified\CMap
fontDir C:\WINDOWS\Fonts
displayCIDFontTT Adobe-GB1 C:\WINDOWS\Fonts\simhei.ttf
#----- end Chinese Simplified support package
6) 创建bat文件pdftohtml.bat(放置的路径不能包含空格)
内容为:
Txt代码
1.@echo off
2.set folderPath=%1
3.set filePath=%2
4.cd /d %folderPath%
5.pdftohtml -enc GBK %filePath%
6.exit
@echo off
set folderPath=%1
set filePath=%2
cd /d %folderPath%
pdftohtml -enc GBK %filePath%
exit
7) 创建类
Java代码
1.public class ConvertPdf
2.{
3. private static String INPUT_PATH;
4. private static String PROJECT_PATH;
5.
6. public static void convertToHtml(String file, String project)
7. {
8. INPUT_PATH = file;
9. PROJECT_PATH = project;
10. if(checkContentType()==0)
11. {
12. toHtml();
13. }
14. }
15.
16. private static int checkContentType()
17. {
18. String type = INPUT_PATH.substring(INPUT_PATH.lastIndexOf(".") + 1, INPUT_PATH.length())
19. .toLowerCase();
20. if (type.equals("pdf"))
21. return 0;
22. else
23. return 9;
24. }
25.
26. private static void toHtml()
27. {
28. if(new File(INPUT_PATH).isFile())
29. {
30. try
31. {
32. String cmd = "cmd /c start X:\\pdftohtml.bat \"" + PROJECT_PATH + "\" \"" + INPUT_PATH + "\"";
33. Runtime.getRuntime().exec(cmd);
34. }
35. catch (IOException e)
36. {
37. e.printStackTrace();
38. }
39. }
40. }
41.
42.}
public class ConvertPdf
{
private static String INPUT_PATH;
private static String PROJECT_PATH;
public static void convertToHtml(String file, String project)
{
INPUT_PATH = file;
PROJECT_PATH = project;
if(checkContentType()==0)
{
toHtml();
}
}
private static int checkContentType()
{
String type = INPUT_PATH.substring(INPUT_PATH.lastIndexOf(".") + 1, INPUT_PATH.length())
.toLowerCase();
if (type.equals("pdf"))
return 0;
else
return 9;
}
private static void toHtml()
{
if(new File(INPUT_PATH).isFile())
{
try
{
String cmd = "cmd /c start X:\\pdftohtml.bat \"" + PROJECT_PATH + "\" \"" + INPUT_PATH + "\"";
Runtime.getRuntime().exec(cmd);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}String cmd = "....";此处代码是调用创建的bat文件进行转换
8) 测试转换
Java代码
1.public static void main(String[] args)
2.{
3. ConvertPdf.convertToHtml("C:\\test.pdf", "X:\\xpdf");
4.}
public static void main(String[] args)
{
ConvertPdf.convertToHtml("C:\\test.pdf", "X:\\xpdf");
}
以上就是整理的内容,后续还会添加视频转换为FLV格式,如果需要的话:)
说的不是很详细,碰到问题的朋友可以自己努力解决一下:)
相关推荐
文件Tools工具 支持WORD/PDF/Excel/PDF等格式的转换软件 支持功能 Word转PDF WORD转EXCEL WORD转EPUB PDF转WORD PDF转EXCEL PDF转PPT PDF版本转换 EXCEL转PDF EXCEL转WORD PDF转EXCEL EPUB转WORD EPUB...
Winform 轻松实现Word/Excel转换为PDF文件
基于poi实现word/excel转换为HTML(且兼容.doc.docx.xls.xlsx) 对于简单的word Excel 转换 足够。excel转换时存在火狐浏览器不兼容乱码问题,希望多多交流。
该软件可把PDF转为word/Excel/PPT/txt等等文件,转换后可以编辑的(除非PDF文件生成前是不可编辑的图片) 本人亲测好用,适合解决网管们帮助办公室其他人员解决PDF转换问题,是IT的福音,屌丝的救星~!
该文件为smallpdf官方下载的安装包,亲测可用,转换快速准确(试用期只有3天,安装后需尽快转换或安装在虚拟机内)
软件可以实现给 word excel pdf 等可以打印的文档 转成图片 或 PDF 文件,并且可以添加盖章和个人签名 支持win7 64 位
中文名: 专业PDF转换Word/PPT/Excel工具 英文名: AnyBizSoft PDF Converter V 2.02 资源格式: 压缩包 版本: 绿色版 发行时间: 2010年08月13日 制作发行: AnyBizSoft 地区: 美国 语言: 英文 简介: 软件类型:软件/...
word文件,excel文件,ppt文件转换成pdf文件,java代码实现,已经集成为工具类,可以直接使用,自测ok
快速转换成精确,完全格式化您的内容,具有很强的可编辑的文件,保留图形,文本格式,段落,列,表头和页脚,等等 - 作出微软Word,Excel,重复利用速度和痛苦。或使用硝基PDF格式专业的工具和看法,全套修改,创建...
AnyBizSoft PDF Converter是一款全面专业的PDF转换器,支持将PDF转换为Word(DOC/DOCX)、PowerPoint(PPT/PPTX)、HTML、TXT等格式,经测试对中文字符(简繁中文)支持良好,转换效果也不错,能够保存原有PDF的页面...
使用java将office word pdf excel ppt文件转换成html文件
Jacob Word excel 转PDF 合并PDF文件,需要安装微软的转换插件,压缩包内含插件
mammoth是一个开源的word文档解析器,可以将word文档转换为HTML格式。使用npm安装mammoth库,引入renderAsync方法将blob数据流传入方法中,渲染word文档。 ```javascript import { defaultOptions, renderAsync } ...
word转换成pdf、excel转换成pdf,能打印的都能转换成pdf文件
本源码主要是ASP.net后台通过相应的类把word\excel\pdf\txt文件转化为html,将地址传回前端,前端获取地址,用iframe进行展现预览。
使用C#将Word、Excel、PPT文件转换成PDF文件 1,使用VS2017编译程序 2,点击添加文件,选择word文件,点击【word转pdf】,PDF文件生成到桌面; 3,点击添加文件,选择excel文件,点击【excel转pdf】,PDF文件生成到...
实现word、excel、PPT 转PDF文件功能。去插件水印,添加word、excel、pdf 文字与图片水印功能。执行转化方法前会分别先执行loadLicense()、getLicenseExcel()、getLicensePpt() 加载license.xml文件,不会出现插件...
本源码主要是ASP.net后台通过相应的类把word\excel\pdf\txt文件转化为html,将地址传回前端,前端获取地址,用iframe进行展现预览。
该项目通过jacob将word转换成pdf图片,在jdk中需要导入jacob的.dll文件,然后将项目导入到工具中直接运行即可,项目中有详细文档
内容概要:基于VBA开发带宏的Excel*.xlsb文件,打开这个Excel文件点击转换按钮,选择需要转换的文件既可将MS Word,Excel,PPT等文档转换为PDF的小软件。 适合人群:无需任何编程基础,只需要会基本操作Excel就可。...