http://www.cqvip.com/onlineread/onlineread.asp?ID=30303017 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
SWFTools提供了一系列將各種文件轉成swf的工具: - font2swf.exe
- gif2swf.exe
- jpeg2swf.exe
- pdf2swf.exe
- png2swf.exe
- wav2swf.exe
具體的功能就顧名思義了。 其中把pdf轉成swf的工具就是pdf2swf了。在命令行中運行pdf2swf src.pdf des.swf一般能滿足需求。而命令行參數可以通過pdf2swf -f得到: 然后看看-s都可以設置些什么: PDF Parameters: PDF device global parameters: fontdir= a directory with additional fonts 指定字體目錄, 與1級參數的-F相若 font= an additional font filename 增加額外的字體文件 pages= the range of pages to convert (example: pages=1-100,210-) 指定頁面范圍,與1級參數的-p相若 zoom= the resolution (default: 72) 指定分辨率,默認為72dpi languagedir= Add an xpdf language directory 增加一個xpdf的語言目錄,對非西歐字符有用 multiply= Render everything at the resolution 在幾倍分辨率下渲染 poly2bitmap Convert graphics to bitmaps 把其中的圖形轉成點陣 bitmap Convert everything to bitmaps 把所有內容轉成點陣(包括字體) SWF Parameters: SWF layer options: jpegsubpixels=<pixels> resolution adjustment for jpeg images (same as jpegdpi, but in pixels) jpeg圖片的分辨率 ppmsubpixels=<pixels> resolution adjustment for lossless images (same asppmdpi, but in pixels) 無損圖片的分辨率 subpixels=<pixels>???? 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=<color)??????? color of links (format: RRGGBBAA)??? 鏈接的顏色 linknameurl???????? Link buttons will be named like the URL they refer to (handy for iterating through links with actionscript) 鏈接名稱與鏈接URL一致 storeallcharacters????? don’t reduce the fonts to used characters in the output file 保存所有的字符字體 enablezlib??????????????? switch on zlib compression (also done if flashversion>=7) 使用zlib壓縮 bboxvars???????????????? store the bounding box of the SWF file in actionscript variables 在as中保存swf的區域大小 dots??????????????????????? Take care to handle dots correctly 保存單點顯示 reordertags=0/1???? (default: 1) perform some tag optimizations 執行某些tag優化 internallinkfunction=<name> when the user clicks a internal link (to a different page) in the converted file, this actionscript function is called 內部鏈接函數,如果點擊一個內部鏈接,將調用該actionscript函數 externallinkfunction=<name> when the user clicks an external link (e.g. http://www.foo.bar/) on the converted file, this actionscript function is called 外部鏈接函數,如果點擊一個外部鏈接,將調用該actionscript函數 disable_polygon_conversion never convert strokes to polygons (will remove capstyles and joint styles) 不要將筆畫轉成多邊形 caplinewidth=<width>??????? the minimum thichness a line needs to have so that capstyles become visible (and are converted)?????????? 線條最低轉換寬度,比這個細的線條將不轉換 insertstop????????????????? put an ActionScript “STOP” tag in every frame 在swf的每個楨中添加stop()函數 protect???????????????????? add a “protect” tag to the file, to prevent loadingin the Flash editor 增加protect標簽,禁止在flash中加載該swf flashversion=<version> the SWF fileversion (6) 設置最低swf版本 framerate=<fps>???????? SWF framerate 設置楨率 minlinewidth=<width> convert horizontal/vertical boxes smaller than thiswidth 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=<quality> set compression quality of jpeg images 設置jpeg的壓縮質量 splinequality=<value> Set the quality of spline convertion to value (0-100, default: 100). 設置樣條曲線的轉換質量 disablelinks??????????????? Disable links. 禁止鏈接 在含中文的pdf轉換時會遇到一些麻煩,具體的解決方法:(javaeye上的文字) 1. 下載swftools:http://www.swftools.org/download.html 下載xpdf xpdf-chinese-simplified 下載兩個中文字體文件 字體文件 2 .安裝swftools 至任意路徑 解壓縮xpdf 至任意路徑 解壓縮中文字體至xdpf\chinese-simplified\CMap文件夾下 3. 修改xpdf下xpdfrc文件 將cidToUnicode 等路徑改為本機路徑, 修改xpdf下chinese-simplified\add-to-xpdfrc文件 同上 4. 打開命令行窗口: pdf2swf -o 輸出文件路徑 -t 輸入文件路徑 -s languagedir=xpdf路徑\chinese-simplified 有些pdf中的圖形轉換效果不好,會產生過多shape,這種情況下可以使用 -s poly2bitmap 的參數,將圖形轉成點陣。生成的swf尺寸少了。 |