云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > SWFTools使用说明

SWFTools使用说明

  • 62 次阅读
  • 3 次下载
  • 2026/1/11 7:52:18

SWFTools 是一组用来处理 Flash 的 swf 文件的工具包,包括:

1. 合并工具 swfcombine 2. 抽取工具 swfextract 3. PDF/JPEG/PNG/AVI/TTF/WAV 到 SWF 的转换工具 :pdf2swf, jpeg2swf, png2swf, avi2swf, font2swf, and wav2swf|

4. 文本解析工具 swfstrings 5. SWF 解析器 swfdump 6. SWF 读写库 rfxswflib

一个简单的将PDF文档转成SWF的用法:

C:\\SWFTools\\pdf2swf Paper3.pdf -o Paper3.swf -f -T 9

pdf2swf man page pdf2swf -s parameters

Current Git

Usage: /usr/local/swft_git/bin/pdf2swf [-options] file.pdf -o file.swf

-h , --help Print short help message and exit -V , --version Print version info and exit

-o , --output file.swf Direct output to file.swf. If file.swf contains '%' (file%.swf), then each page goes to a seperate file.

-p , --pages range Convert only pages in range with range e.g. 1-20 or 1,4,6,9-11 or

-P , --password password Use password for deciphering the pdf.

-v , --verbose Be verbose. Use more than one -v for greater effect. -z , --zlib Use Flash 6 (MX) zlib compression.

-i , --ignore Allows pdf2swf to change the draw order of the pdf. This may make the generated

-j , --jpegquality quality Set quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)

-s , --set param=value Set a SWF encoder specific parameter. See pdf2swf -s help for more information. -w , --samewindow When converting pdf hyperlinks, don't make the links open a new window.

-t , --stop Insert a stop() command in each page. -T , --flashversion num Set Flash Version in the SWF header to num. -F , --fontdir directory Add directory to the font search path. -b , --defaultviewer Link a standard viewer to the swf file.

-l , --defaultloader Link a standard preloader to the swf file which will be displayed while the main swf is loading.

-B , --viewer filename Link viewer filename to the swf file. -L , --preloader filename Link preloader filename to the swf file.

-q , --quiet Suppress normal messages. Use -qq to suppress warnings, also.

-S , --shapes Don't use SWF Fonts, but store everything as shape. -f , --fonts Store full fonts in SWF. (Don't reduce to used characters).

-G , --flatten Remove as many clip layers from file as possible. -I , --info Don't do actual conversion, just display a list of all pages in the PDF.

-Q , --maxtime n Abort conversion after n seconds. Only available on Unix.

-s Set a SWF encoder specific

PDF Parameters:

PDF device global parameters:

fontdir=

a directory with additional fonts

font= an additional font filename

pages= the range of pages to convert (example: pages=1-100,210-) zoom= the resultion (default: 72) languagedir=

Add an xpdf language directory

multiply= Render everything at the resolution poly2bitmap Convert graphics to bitmaps bitmap Convert everything to bitmaps SWF Parameters:

SWF layer options:

jpegsubpixels= resolution adjustment for jpeg images (same as jpegdpi, but in pixels)

ppmsubpixels=

subpixels= shortcut for setting both jpegsubpixels and ppmsubpixels

drawonlyshapes convert everything to shapes (currently broken) ignoredraworder allow to perform a few optimizations for creating smaller SWFs

linksopennewwindow make links open a new browser window

linktarget target window name of new links linkcolor=

linknameurl Link buttons will be named like the URL they refer to (handy for

iterating through links with actionscript)

storeallcharacters don't reduce the fonts to used characters in the output file

enablezlib switch on zlib compression (also done if flashversion>=6)

bboxvars store the bounding box of the SWF file in actionscript variables

dots Take care to handle dots correctly

reordertags=0/1 (default: 1) perform some tag optimizations

internallinkfunction= when the user clicks a internal link (to a different page) in the converted file, this actionscript function is called

externallinkfunction= when the user clicks an external link (e.g. http://www.foo.bar/) on the converted file, this actionscript function is called disable_polygon_conversion never convert strokes to polygons (will remove capstyles and joint styles)

caplinewidth= the minimum thichness a line needs to have so that capstyles become visible (and are converted)

insertstop put an ActionScript \

protect add a \the Flash editor

flashversion= the SWF fileversion (6)

framerate= SWF framerate

minlinewidth= convert horizontal/vertical boxes smaller than this width to lines (0.05)

simpleviewer Add next/previous buttons to the SWF

animate insert a showframe tag after each placeobject (animate draw order of PDF files)

jpegquality= set compression quality of jpeg images

splinequality= Set the quality of spline convertion to value (0-100, default: 100).

disablelinks Disable links.

通过代码将PDF转换成SWF来说,现在比较常用的一种方式就是利用SWFTools工具中的pdf2swf(http://www.swftools.org/)。这个工具还是比较好用的。转换成的SWF文件质量也不错。 /**

Java代码

* PDF转SWF工具

* @author tangs

* */

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 = \ + destPath + \ languagedir=D:\\\\xpdf\\\\xpdf-chinese-simplified -s flashversion=9 \\\ sourcePath + \

Process pro = Runtime.getRuntime().exec(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 = \ String destPath = \

String fileName = \

Converter.convertPDF2SWF(sourcePath, destPath, fileName); } }

搜索更多关于: SWFTools使用说明 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

SWFTools 是一组用来处理 Flash 的 swf 文件的工具包,包括: 1. 合并工具 swfcombine 2. 抽取工具 swfextract 3. PDF/JPEG/PNG/AVI/TTF/WAV 到 SWF 的转换工具 :pdf2swf, jpeg2swf, png2swf, avi2swf, font2swf, and wav2swf| 4. 文本解析工具 swfstrings 5. SWF 解析器 swfdump 6. SWF 读写库 rfxswflib 一个简单的将PDF文档转成SWF的用法: C:\\SWFTools\\pdf2swf Paper3.pdf -o Paper3.swf -f -T 9 pdf2swf man page pdf2sw

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com