package org.forever.util;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
public class FlashPaperUtil {
private static final String UNINSTALL_BAT = "uninstall.bat";
private static final String INSTALL_BAT = "install.bat";
private static Logger log = Logger.getLogger(FlashPaperUtil.class);
private static final String CMD_C_START = "cmd /c start ";
private static final String FLASH_PRINTER_EXE = "FlashPrinter.exe";
private static final String FLASH_PAPER2_2 = "FlashPaper2.2";
private static final String SPACE = " ";
private static String flashPaperDir;
private static String flashPrinterPath;
private static String installPath;
private static String unInstallPath;
private static Runtime runtime = Runtime.getRuntime();
private static Map<String, String> fileMap = new HashMap<String, String>();
private static FlashPaperUtil instance;
private FlashPaperUtil(){
flashPaperDir =
FlashPaperUtil.class.getClassLoader().getResource(
FLASH_PAPER2_2).getFile();
for (File file : new File(flashPaperDir).listFiles()) {
fileMap.put(file.getName(), file.getAbsolutePath());
}
flashPrinterPath = fileMap.get(FLASH_PRINTER_EXE);
installPath = fileMap.get(INSTALL_BAT);
unInstallPath = fileMap.get(UNINSTALL_BAT);
}
public static FlashPaperUtil getInstance(){
if(null == instance){
synchronized (FlashPaperUtil.class) {
instance = new FlashPaperUtil();
}
}
return instance;
}
public void docToSwf(String docPath, String outPath)
throws Exception {
String command = flashPrinterPath + SPACE + docPath + SPACE + "-o"
+ SPACE + outPath;
Process process = runtime.exec(command);
process.waitFor();
process.destroy();
File outFile = new File(outPath);
if(outFile.exists()){
log.info("docToSwf success.........");
}
}
public void install() throws Exception {
String cmd = CMD_C_START + installPath;
Process process = runtime.exec(cmd,null,new File(flashPaperDir));
process.waitFor();
process.destroy();
log.info("install success..........");
}
public void uninstall() throws Exception {
String cmd = CMD_C_START + unInstallPath;
Process process = runtime.exec(cmd,null,new File(flashPaperDir));
process.waitFor();
process.destroy();
log.info("uninstall success..........");
}
public static void main(String[] args) throws Exception {
FlashPaperUtil.getInstance();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
FlashPaper 转pdf及swf
共62个文件
dll:20个
swf:6个
exe:6个
4星 · 超过85%的资源 需积分: 10 21 下载量 62 浏览量
2011-11-18
09:12:12
上传
评论
收藏 7.45MB RAR 举报
温馨提示
FlashPaper 转pdf及swfFlashPaper 转pdf及swfFlashPaper 转pdf及swfFlashPaper 转pdf及swfFlashPaper 转pdf及swfFlashPaper 转pdf及swfFlashPaper 转pdf及swf
资源推荐
资源详情
资源评论
收起资源包目录
FlashPaper转swf.rar (62个子文件)
readme.wps 27KB
DocReadDemo
.project 1KB
.mymetadata 306B
WebRoot
WEB-INF
web.xml 381B
lib
junit-4.7.jar 227KB
log4j-1.2.15.jar 383KB
classes
org
forever
util
FlashPaperUtil.class 4KB
log4j.properties 462B
FlashPaper2.2
FlashPaperContextMenu.dll 160KB
Macromedia_Licensing_Installer.dll 277KB
fpdriversetup.exe 96KB
gdiplus.dll 1.63MB
flashpaperprinterui2.dll 296KB
FlashPrinter.exe 1.44MB
xerces.dll 1.88MB
OfficePrintAddIn.dll 620KB
FPUIProto.dot 19KB
Working.swf 4KB
fputilsetup.exe 72KB
msvcr71.dll 340KB
fpwrap.htm 1KB
license.inf 3KB
Interface
DefaultViewer2.swf 49KB
install.bat 292B
flashpaperprinterdrv2.dll 399KB
Flash.ocx 1.34MB
XML
FlashPaper.xsd 19KB
FPXlink.xsd 316B
Searching.swf 2KB
uninstall.bat 560B
msvcp71.dll 488KB
pdflib.dll 900KB
index.jsp 681B
abc.doc 52KB
META-INF
MANIFEST.MF 39B
src
org
forever
util
FlashPaperUtil.java 2KB
log4j.properties 462B
FlashPaper2.2
FlashPaperContextMenu.dll 160KB
Macromedia_Licensing_Installer.dll 277KB
fpdriversetup.exe 96KB
gdiplus.dll 1.63MB
flashpaperprinterui2.dll 296KB
FlashPrinter.exe 1.44MB
xerces.dll 1.88MB
OfficePrintAddIn.dll 620KB
FPUIProto.dot 19KB
Working.swf 4KB
fputilsetup.exe 72KB
msvcr71.dll 340KB
fpwrap.htm 1KB
license.inf 3KB
Interface
DefaultViewer2.swf 49KB
install.bat 292B
flashpaperprinterdrv2.dll 399KB
Flash.ocx 1.34MB
XML
FlashPaper.xsd 19KB
FPXlink.xsd 316B
Searching.swf 2KB
uninstall.bat 560B
msvcp71.dll 488KB
pdflib.dll 900KB
.classpath 509B
共 62 条
- 1
资源评论
- wuchao01232014-04-15找了很久才找到的资源,不用不是很好用
- kinghelloworld2012-03-17稳定性不高,已用flexpaper+openoffice解决。
- CSsinba2011-12-05包是全的,但是感觉FlashPaper还是不太好用
wuxiaoxu666
- 粉丝: 2
- 资源: 73
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功