package com.flex.demo;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
public class Converter {
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命令进行转换
String command = "C:\\Program Files\\SWFTools\\pdf2swf.exe" + " -o \"" + destPath + fileName +"%.swf"+ "\" -s flashversion=9 \"" + sourcePath + "\"";
// String command = "C:\\Program Files\\SWFTools\\pdf2swf.exe" + " -o \"" + destPath +"\\" + fileName + "\" -s flashversion=9 \"" + sourcePath + "\"";
// command = "C:\\Program Files\\SWFTools\\pdf2swf.exe" + " -o \"" + "D:\\" + "\\" + "test2.swf" + "\" -s flashversion=9 \"" + "D:\\test.pdf" + "\"";
// command = "C:\Program Files\SWFTools\pdf2swf.exe -o " D:\" \" + "test2.swf" + "\" -s flashversion=9 \"" + "D:\\test.pdf" + "\"";
Process pro = Runtime.getRuntime().exec(command);
System.out.println(command);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(pro.getInputStream()));
while (bufferedReader.readLine() != null);
try {
pro.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pro.exitValue();
}
public static void main(String []args) throws IOException {
String sourcePath = "D:\\test.pdf";
String fileName = "test";
String destPath = "E:\\testpdf\\"+fileName+"\\";
Converter.convertPDF2SWF(sourcePath, destPath, fileName);
}
}
flexpaper 延时加载(分页加载)
4星 · 超过85%的资源 需积分: 9 94 浏览量
2011-08-30
14:31:47
上传
评论
收藏 12.59MB ZIP 举报
guozhiguo86
- 粉丝: 42
- 资源: 2
最新资源
- 技术面试最后反问面试官的话 校招面试非技术问题有哪些 非技术问题如何回答.png
- NB-IOT-BC26全网通模块Altium+ CADENCE +PADS三种格式(原理图SCH+PCB封装库)文件.zip
- 基于微信小程序开发的校园失物招领系统源码毕业设计(优质项目源码).zip
- 词向量是一种将自然语言中的单词转换为数值向量的技术,它能够捕捉词义和上下文信息
- nmap与masscan的简单使用
- MyBatis动态SQL.pdf
- 基于stm32单片机protues仿真的温湿度控制系统设计(仿真图、源代码)
- 词向量:自然语言处理的基石
- mybatis动态sql
- 40G微信小程序开发教程(工具插件+视频教程)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
- 4
- 5
- 6
前往页