加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

文档在线预览(三)- 使用SWFTools转换文档为SWF格式

发布时间:2020-12-15 18:16:45 所属栏目:百科 来源:网络整理
导读:1.SWFTools介绍 ??????? SWFTools is a collection of utilities for working with Adobe Flash files (SWF files). The tool collection includes programs for reading SWF files,combining them,and creating them from other content (like images,sound

1.SWFTools介绍

??????? SWFTools is a collection of utilities for working with Adobe Flash files (SWF files). The tool collection includes programs for reading SWF files,combining them,and creating them from other content (like images,sound files,videos or sourcecode). SWFTools is released under the GPL.?

??????? 使用SWFTools就可以实现我们的功能,将PDF文件转换成SWF格式。SWFTools可以讲很多格式的文件转换为SWF。

官网地址:http://www.swftools.org/

下载地址:http://download.csdn.net/detail/jolingogo/5075059

2.示例

这是一个安装程序,先安装一下

这里使用的是0.9.2版本,我们用Java调用命令的方式来使用这个软件

pdf2swf -s - Set a SWF encoder specific parameter

    Usage: ./pdf2swf -s [option][=value] input.pdf -o output.swf 

package org.ygy.util;

import java.io.IOException;

public class SWFUtil {
	public static final String SWFPATH = "D:/Program Files/SWFTools/pdf2swf.exe";//安装的路径
	
	public static void toSWF(String sourcePath,String targetPath) {
		String cmd = SWFPATH + " "" + sourcePath + "" -o "" + targetPath+ "" -T 9";
		System.out.println(cmd);
		try {
			Runtime.getRuntime().exec(cmd);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		SWFUtil.toSWF("E://demo_1.pdf","E://demo_s.swf");
	}
}
详细介绍的话,可以参考官网文档。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读