把pdf文档转化为swf
2012-05-15 10:43
232 查看
1.下载swftools,并安装在自己的电脑上。我这里把swftools安装在C盘(C:\SWFTools)。
2.使用命令行把pdf文档转换为swf文件,C:\SWFTools\pdf2swf -t
sourcePath -o
destFileName -s flashversion=9
写命令的时候要特别注意flash的版本问题,默认转换出来的是flash8版本。
也可以用代码来实现(摘自网上,未验证):
</pre><pre class="java" name="code">package bao1;
import java.io.*;
public class Converter extends java.lang.Thread{
public static int convertPDF2SWF(String sourcePath, String destPath, String fileName) throws IOException {
//目标路径不存在则建立目标路径
File dest = new File(destPath);
if (!dest.exists()) dest.mkdirs();
//源文件不存在则返回
File source = new File(sourcePath);
if (!source.exists()) return 0;
//调用pdf2swf命令进行转换
//调用pdf2swf命令进行转换
String command= "G:\\SWFTools\\pdf2swf"+" -t "+sourcePath+" -o "+destPath+fileName+" -s flashversion=9 ";
Process pro = Runtime.getRuntime().exec(command);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(pro.getInputStream()));
while (bufferedReader.readLine() != null);
try {
pro.waitFor();
// pro2.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pro.exitValue();
}
}
2.使用命令行把pdf文档转换为swf文件,C:\SWFTools\pdf2swf -t
sourcePath -o
destFileName -s flashversion=9
写命令的时候要特别注意flash的版本问题,默认转换出来的是flash8版本。
也可以用代码来实现(摘自网上,未验证):
</pre><pre class="java" name="code">package bao1;
import java.io.*;
public class Converter extends java.lang.Thread{
public static int convertPDF2SWF(String sourcePath, String destPath, String fileName) throws IOException {
//目标路径不存在则建立目标路径
File dest = new File(destPath);
if (!dest.exists()) dest.mkdirs();
//源文件不存在则返回
File source = new File(sourcePath);
if (!source.exists()) return 0;
//调用pdf2swf命令进行转换
//调用pdf2swf命令进行转换
String command= "G:\\SWFTools\\pdf2swf"+" -t "+sourcePath+" -o "+destPath+fileName+" -s flashversion=9 ";
Process pro = Runtime.getRuntime().exec(command);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(pro.getInputStream()));
while (bufferedReader.readLine() != null);
try {
pro.waitFor();
// pro2.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pro.exitValue();
}
}
相关文章推荐
- 在Web程序中将doc,pdf,jpg等文档转化为swf之FlashPaper终极配置
- window server平台下在Web程序中将doc,pdf,jpg等文档转化为swf之FlashPaper(方法一)
- 把pdf文档转化为swf并显示
- java实现MsOffice文档向pdf转化之OpenOffice软件
- 把office文档转化为pdf并在线显示
- 实现Word、Excel、Txt文档在线转换为Swf(或PDF)
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- 最近抽时间写了个文档转化工具DocConvert,支持把任何文档转化为PDF,BMP,JPG,PNG,PCX....
- 将PDF文档转化为Word文档
- flex实现百度库文浏览文档使用word文档转pdf然后再用pdf转swf最后flex页面使用flexpaper显示文库数据
- asp.net 实现pdf、swf等文档的浏览
- 在网页中在线查看文档(doc、docx 、xls 、xlsx、 pdf 、swf )
- 在线显示PDF文档:基于SWFTools + FlexPaper
- C#中使用FlashPrinter将WORD文档转成PDF或者SWF
- swftools——将PDF转成swf 帮助文档【转】
- FlexPaper+SWFTools 实现仿百度文库,在线查看PDF文档
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper] 使用JODConverter将office文档转换为pdf
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- PDF转化成PPT格式文档步骤
- 转化MAN帮助文档为PDF