1. linux下卸载swftools工具
你用的是什么方式安装的?
1. yum install packagename yum安装?
2. rpm -ivh packagename rpm安装?
3. ./configure && make && make install 源码编译安装?
4. 用的图形界面安装?
这要看你选择是怎样的安装方式了?根据每种安装方式的不同有不同的卸载方式。
2. linux安装swftools 执行make时报错
在swftools最新版本,FAQ标签中给出freetype库和jpeglib库的连接,freetype选择版本freetype-2.1.10.tar.gz,jpeglib选择版本jpegsrc.v8c.tar.gz。
先安装gcc、gcc-c++、zlib、zlib-devel
解压命令: tar -zxvf xxx.tar,解压下来的freetype、jpeglib安装包
进入安装包目录
然后执行:
./configure
make
make install
解压swftools,进入安装包目录,执行以下命令:
ldconfig /usr/local/lib
./configure
make
make install
make clean
make distclean
whereis pdf2swf
运行./configure命令时出现:
checking build system
type Invalid configuration 'i686-pc-linux-': machine 'i686-pc-linux' not
recognized
configure: error:
/bin/sh ./config.sub i686-pc-linux- failed
就换为执行: ./configure --build=i686-pc-linux-gnu
运行出现:make: Nothing to be done for `unix'.
执行: make clean
然在再执行make即可
如出现创建文件时间问题,调整linux系统时间即可。
3. linux安装swftools 执行make时报错
在swftools官网下载最新版本,官网FAQ标签中给出freetype库和jpeglib库的连接,freetype选择版本freetype-2.1.10.tar.gz,jpeglib选择版本jpegsrc.v8c.tar.gz。
先安装gcc、gcc-c++、zlib、zlib-devel
解压命令: tar -zxvf xxx.tar,解压下载下来的freetype、jpeglib安装包
进入安装包目录
然后执行:
./configure
make
make install
解压swftools,进入安装包目录,执行以下命令:
ldconfig /usr/local/lib
./configure
make
make install
make clean
make distclean
whereis pdf2swf
运行./configure命令时出现:
checking build system
type... Invalid configuration 'i686-pc-linux-': machine 'i686-pc-linux' not
recognized
configure: error:
/bin/sh ./config.sub i686-pc-linux- failed
就换为执行: ./configure --build=i686-pc-linux-gnu
运行出现:make: Nothing to be done for `unix'.
执行: make clean
然在再执行make即可
如出现创建文件时间问题,调整linux系统时间即可。
4. swftools分linux版本吗
方法/步骤
查找swftools官网
下载安装包
将安装包放到你喜欢的目录
安装依赖包
yum -y install gcc zlib* freetype jpeglib* ungif* jpeglib.h* freetype* gif_lib.h* jpeg* jpeg-devel libjpeg-devel g++ gcc++ gcc*
解压安装包
tar -xzvf swfools***
进入安装目录
cd swftools***
执行
./configure --prefix=/usr/local/swftools(后面的参数为指定安装目录)
make
make install
这里可能出现安装不成功,需要修改两个make文件
里面的rm命令多了两个参数-o -l把里面所有这两个参数都去掉再make install即可
5. swftools支持solaris10吗(官网里只有linux和windows的版本)急!急!急!!!在线恭候。
这个好像不行~solaris10其实是unix系统。
6. openoffice+swftools+flexpaper实现在线预览,是不是每台电脑都要安装
1.概述
主要原理
1.通过第三方工具openoffice,将word、excel、ppt、txt等文件转换为pdf文件
2.通过swfTools将pdf文件转换成swf格式的文件
3.通过FlexPaper文档组件在页面上进行展示
2.安装包下载
1.openoffice是Apache下的一个开放免费的文字处理软件
下载地址:Apache oppenoffice 官网下载 版本-3.4.1
2.SWFTools是一组用来处理Flash的swf文件的工具包,我们使用它将pdf文件转成swf文件!
下载地址:SWFTools官网下载 swftools-2013-04-09-1007.exe
3.FlexPaper是一个开源轻量级的在浏览器上显示各种文档的组件
下载地址:FlexPaper官网下载 版本1.5.1
4.JODConverter一个java的OpenDocument 文件转换器,在此我们只用到它的jar包
下载地址:JODCConverter下载
3.安装文件
1.将所下载的文件(JODConverter除外)进行安装,盘符可随自己设定!需要注意的是在openoffice安装完成后,当我们使用它时,需将它的服务打开。在次我们需要以命令的方式打开:
打开dos窗口,进入openoffice安装盘符,输入以下代码来启动服务:
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
注意最后一个命令前边的‘—’,可不要写错!服务起不来,项目可是继续不下去的哦.
7. linux中安装swftools,在make时总出现这个错误,哪位高手帮我看看,感谢不尽!
我在RHEL 6.3 x86_64编译没有问题
./configure的时候没有错误吗
这个可能是 缺少gcc或者g++,还可能有依赖包,把这些包都装上
yum install gcc-c++
yum-y install giflib-devel libjpeg-devel freetype-devel t1lib-devel zlib
然后再执行
ldconfig
./configure
make
make install
8. flexpaper在线预览问题java linux office文件在线预览的时候出现如图的问题,不能预览,求大神帮忙
swftools-0.9.1.exe 和 FlexPaper_1.4.5_flash.zip,工具网上下载。
二、PDF转换SWF文件核心类:
public class DocConverter {
private static final int environment = 1;// 环境1:windows,2:linux(涉及pdf2swf路径问题)
private String fileString;
private String outputPath = "";// 输入路径,如果不设置就输出在默认位置
private String fileName;
private File pdfFile;
private File swfFile;
private File docFile;
public DocConverter(String fileString) {
ini(fileString);
}
/*
* 重新设置 file @param fileString
*/
public void setFile(String fileString) {
ini(fileString);
}
/*
* 初始化 @param fileString
*/
private void ini(String fileString) {
this.fileString = fileString;
fileName = fileString.substring(0, fileString.lastIndexOf("."));
docFile = new File(fileString);
pdfFile = new File(fileName + ".pdf");
swfFile = new File(fileName + ".swf");
}
/*
* 转为PDF @param file
*/
/*
* 转换成swf
*/
private void pdf2swf() throws Exception {
Runtime r = Runtime.getRuntime();
if (!swfFile.exists()) {
if (pdfFile.exists()) {
if (environment == 1)// windows环境处理
{
try {
// 这里根据SWFTools安装路径需要进行相应更改
Process p = r.exec("G:/Program Files/SWFTools/pdf2swf.exe " + pdfFile.getPath() + " -o " + swfFile.getPath() + " -T 9");
System.out.print(loadStream(p.getInputStream()));
System.err.print(loadStream(p.getErrorStream()));
System.out.print(loadStream(p.getInputStream()));
System.err.println("****swf转换成功,文件输出:" + swfFile.getPath() + "****");
if (pdfFile.exists()) {
// pdfFile.delete();
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
} else if (environment == 2)// linux环境处理
{
try {
Process p = r.exec("pdf2swf " + pdfFile.getPath() + " -o " + swfFile.getPath() + " -T 9");
System.out.print(loadStream(p.getInputStream()));
System.err.print(loadStream(p.getErrorStream()));
System.err.println("****swf转换成功,文件输出:" + swfFile.getPath() + "****");
if (pdfFile.exists()) {
pdfFile.delete();
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
} else {
System.out.println("****pdf不存在,无法转换****");
}
} else {
System.out.println("****swf已存在不需要转换****");
}
}
static String loadStream(InputStream in) throws IOException {
int ptr = 0;
//把InputStream字节流 替换为BufferedReader字符流 2013-07-17修改
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder buffer = new StringBuilder();
while ((ptr = reader.read()) != -1) {
buffer.append((char) ptr);
}
return buffer.toString();
}
/*
* 转换主方法
*/
public boolean conver() {
if (swfFile.exists()) {
System.out.println("****swf转换器开始工作,该文件已经转换为swf****");
return true;
}
if (environment == 1) {
System.out.println("****swf转换器开始工作,当前设置运行环境windows****");
} else {
System.out.println("****swf转换器开始工作,当前设置运行环境linux****");
}
try {
// doc2pdf();
pdf2swf();
} catch (Exception e) {
// TODO: Auto-generated catch block
e.printStackTrace();
return false;
}
if (swfFile.exists()) {
return true;
} else {
return false;
}
}
/*
* 返回文件路径 @param s
*/
public String getswfPath() {
if (swfFile.exists()) {
String tempString = swfFile.getPath();
tempString = tempString.replaceAll("\\\\", "/");
return tempString;
} else {
return "";
}
}
/*
* 设置输出路径
*/
public void setOutputPath(String outputPath) {
this.outputPath = outputPath;
if (!outputPath.equals("")) {
String realName = fileName.substring(fileName.lastIndexOf("/"), fileName.lastIndexOf("."));
if (outputPath.charAt(outputPath.length()) == '/') {
swfFile = new File(outputPath + realName + ".swf");
} else {
swfFile = new File(outputPath + realName + ".swf");
}
}
}
}
三、JSP文件,注意引入的几个js文件和FlexPaperViewer.swf文件,其中FlexPaperViewer.swf和jsp文件放在同一目录即可。
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String paths=(String)request.getAttribute("swfpath");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>te</title>
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; }
#flashContent { display:none; }
</style>
<script type="text/javascript" src="<%=basePath %>js/swfobject/swfobject.js"></script>
<script type="text/javascript" src="<%=basePath %>js/flexpaper_flash.js"></script>
<script type="text/javascript">
//<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
var swfVersionStr = "10.0.0";
//<!-- To use express install, set to playerProctInstall.swf, otherwise the empty string. -->
/* var xiSwfUrlStr = "playerProctInstall.swf"; */
var xiSwfUrlStr = ""; //值可以任意
var flashvars = {
SwfFile : escape("<%=basePath+paths%>"), //swf文件路径(lucene4.6和页面同一个位置)
Scale : 0.6,
ZoomTransition : "easeOut",
ZoomTime : 0.5,
ZoomInterval : 0.1,
FitPageOnLoad : false,
FitWidthOnLoad : true,
PrintEnabled : true,
FullScreenAsMaxWindow : false,
ProgressiveLoading : true,
PrintToolsVisible : true,
ViewModeToolsVisible : true,
ZoomToolsVisible : true,
FullScreenVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,
localeChain: "en_US"
};
var params = {
}
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "FlexPaperViewer";
attributes.name = "FlexPaperViewer";
swfobject.embedSWF(
"FlexPaperViewer.swf", "flashContent",
"1024", "700",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
swfobject.createCSS("#flashContent", "display:block;text-align:center;");
</script>
</head>
<body>
<div style="width: 100%;height: 90%; text-align: center;">
<div id="flashContent">
</div>
</div>
</body>
</html>
9. 如何在linux下安装swftools
可以使用apt-get install指令
或者下载源码进行make安装