当前位置: 代码迷 >> 综合 >> SWFTools 笔记
  详细解决方案

SWFTools 笔记

热度:14   发布时间:2024-01-15 22:46:45.0
1\
SWFTools 把大文件分割成小文件
2\
SWFTools 开源了解
http://wiki.swftools.org/index.php?title=Talk:Pdf2swf&action=edit

3\
SWFTools 能在linux平台下跑吗
参考
Hello,

I’ve been using swftools, mainly pdf2swf functionality, for a while now and installation always sucked. Google usually provides good results for common problems, but lack of a step-by-step installation guide is lacking.

Main site, http://swftools.org, has pretty good wiki for documentation and a tidy installation walkthrough. Unfortunately for me I had a ton of problems getting pdf2swf to work properly on Amazon’s AWS Ubuntu server (ami-5059be39 – ubuntu-intrepid), but fortunately for you I finally got it working and also put together this guide, which will hopefully save you some time.

Note: swftools version that comes default with aptitude would not work for me hence the need to compile from source.
Note2: this guide assumes the distro is up to date and all system libraries have been installed from Installing RoR on Ubuntu post

Get necessary libraries and extract


wget http://swftools.org/swftools-0.9.0.tar.gz
tar -zvxf swftools-0.9.0.tar.gz
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
tar -zvxf jpegsrc.v7.tar.gz
wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.3.12.tar.gz
tar -zvxf freetype-2.3.12.tar.gz


Note: v8 produced errors in swftools install so I grabbed v7, which worked wonderfully.

Now order of install. First we install jpeg:

cd jpegsrc.v7
sudo ./configure
sudo make
sudo make installFreetype is a little trickier. For install you have to reset cache, set flags, run ranlib (not sure why but it wouldn’t work without for me, if you know I’d love an explanation)


rm -f config.cache
sudo ranlib /usr/local/lib/libjpeg.a
sudo ldconfig /usr/local/lib
sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
sudo make
sudo make installIf you want to be able to convert pdf files into text you have to install xpdf. Fortunately aptitude does provide us with the right libraries this time.

sudo apt-get install xpdf-readerAnd now for the final step:

cd swftools-0.9.0
sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
sudo make
sudo make installBig thanks to swftools for making this possible.

Best,

Mikhail


--------------------------------------------------------------------------------

Possibly related posts: (automatically generated)

How to setup RoR+Passenger+MySql+Ubuntu Server on EC2
Install ConnectomeViewer on Ubuntu 9.10
Building R8187 driver (Aircrack-ng compatible) for Kernel 2.6.34
How to upgrade OpenERP on Linux


http://designbye.wordpress.com/2010/02/23/installing-swftools-and-pdf2swf-on-ubuntu-linux/
http://swftools.org/
http://www.nginxs.com/linux/tag/linux-pdf2swf-swf-pdf-swf

c: 文章标签 ‘linux pdf2swf swf pdf-swf’
linux PDF转换为SWF
2010年1月26日 eric 没有评论
由于工程需要把用户上传的PDF转换为SWF,服务器要求也是linux,所以就想到 swftools,官方网站:http://www.swftools.org/可以把很多文件转换为swf,他默认只支持 英文,中文转换出来是乱码,所以我们要下载中文字库。中途遇到不少问题,都慢慢解决了,参数也明白了,大家看我的记载吧。

环境:

Server : ubuntu-server 8.0.4

software: xpdf-chinese-simplified.tar.gz font.zip

##给操作系统安装中文字库

shell $> apt-get install language-support-fonts-zh

##安装软件

shell $> apt-get install swftools
分类: linux, ubuntu 标签: linux pdf2swf swf pdf-swf
d:

wget http://swftools.org/swftools-0.9.0.tar.gz
tar -zvxf swftools-0.9.0.tar.gz
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
tar -zvxf jpegsrc.v7.tar.gz
wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.3.12.tar.gz
tar -zvxf freetype-2.3.12.tar.gz

4\
flexPage加载大文件


1\

Pdf2swf
From Swftools
Jump to: navigation, search
Current Stable


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=<dir> a directory with additional fonts
font=<filename> an additional font filename
pages=<range> the range of pages to convert (example: pages=1-100,210-)
zoom=<dpi> the resultion (default: 72)
languagedir=<dir> Add an xpdf language directory
multiply=<times> Render everything at <times> 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)
ppmsubpixels=<pixels resolution adjustment for lossless images (same as ppmdpi, 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)
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=<name> when the user clicks a internal link (to a different page) in the converted file, this actionscript function is called
externallinkfunction=<name> 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=<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
protect add a "protect" tag to the file, to prevent loading in the Flash editor
flashversion=<version> the SWF fileversion (6)
framerate=<fps> SWF framerate
minlinewidth=<width> 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=<quality> set compression quality of jpeg images
splinequality=<value> Set the quality of spline convertion to value (0-100, default: 100).
disablelinks Disable links.

pdf2swf Resources
pdf2swf example+test documents
pdf2swf FAQs
How do I convert password protected pdf's?
How do I define link targets?
How do I create my own viewer?
How do I create a AVM2 compatible SWF?
How do I highlight text in the SWF?
Retrieved from "http://wiki.swftools.org/index.php/Pdf2swf"