Configuring SWFTools
By default the application comes with a Tomcat bundle with pre-configured SWFTools.
Ubuntu
Section titled “Ubuntu”sudo add-apt-repository ppa:guilhem-fr/swftoolssudo apt-get updatesudo apt-get install swftoolsImproving performance
For better performance, use this configuration.
| Property | Description |
|---|---|
| system.swftools.pdf2swf | The Pdf2swf tool is used to convert PDF documents to SWF. /usr/bin/pdf2swf -T 9 -f -t -G -s storeallcharacters ${fileIn} -o ${fileOut} |
The parameters specify that:
- -f : Fonts should be embedded; this improves searchability in the document
- -t : Inserts a stop between each frame; this improves stability
- -G : Makes the document smaller and faster to render
- -s storeallcharacters : Stores all character information about the text in the document; this improves searchability
Red Hat and CentOS
Section titled “Red Hat and CentOS”It is better to compile version 0.9.x
yum install zlib-devel libjpeg-devel giflib-devel freetype-devel gcc gcc-c++wget http://www.swftools.org/swftools-0.9.1.tar.gztar xzf swftools-0.9.1.tar.gzcd swftools-0.9.1./configure --prefix=/usr/localmakemake installImproving performance
Section titled “Improving performance”For better performance, use this configuration.
| Property | Description |
|---|---|
| system.swftools.pdf2swf | The Pdf2swf tool is used to convert PDF documents to SWF. /usr/bin/pdf2swf -T 9 -f -t -G -s storeallcharacters ${fileIn} -o ${fileOut} |
The parameters specify that:
- -f : Fonts should be embedded; this improves searchability in the document
- -t : Inserts a stop between each frame; this improves stability
- -G : Makes the document smaller and faster to render
- -s storeallcharacters : Stores all character information about the text in the document; this improves searchability
Debian
Section titled “Debian”This package is not included in the Debian repositories, so you need to compile it from source:
aptitude install build-essential libgif-dev xpdf libfreetype6 libfreetype6-dev libjpeg62 libjpeg8 libjpeg8-devwget http://www.swftools.org/swftools-0.9.1.tar.gztar xzf swftools-0.9.1.tar.gzcd swftools-0.9.1./configure --prefix=/usr/localmakemake installImproving performance
Section titled “Improving performance”For better performance, use this configuration.
| Property | Description |
|---|---|
| system.swftools.pdf2swf | The Pdf2swf tool is used to convert PDF documents to SWF. /usr/bin/pdf2swf -T 9 -f -t -G -s storeallcharacters ${fileIn} -o ${fileOut} |
The parameters specify that:
- -f : Fonts should be embedded; this improves searchability in the document
- -t : Inserts a stop between each frame; this improves stability
- -G : Makes the document smaller and faster to render
- -s storeallcharacters : Stores all character information about the text in the document; this improves searchability
Windows
Section titled “Windows”Download the latest SWFTools http://www.swftools.org/download.html and install it (for example at c:\tomcat-8.5.69\tools\swftools).
Improving performance
Section titled “Improving performance”For better performance, use this configuration.
| Property | Description |
|---|---|
| system.swftools.pdf2swf | The Pdf2swf tool is used to convert PDF documents to SWF. c:\tomcat-8.5.69\tools\swftools\pdf2swf.exe -T 9 -f -t -G -s storeallcharacters ${fileIn} -o ${fileOut} |
The parameters specify that:
- -f : Fonts should be embedded; this improves searchability in the document
- -t : Inserts a stop between each frame; this improves stability
- -G : Makes the document smaller and faster to render
- -s storeallcharacters : Stores all character information about the text in the document; this improves searchability
Troubleshooting
Section titled “Troubleshooting”Conversion problems with big files
Section titled “Conversion problems with big files”If the document is large (has many pages) or is complex, the conversion may fail with this error:
You can work around this error by adding the -s poly2bitmap parameter, which converts graphics to bitmaps:
| Property | Description |
|---|---|
| system.swftools.pdf2swf | /usr/bin/pdf2swf -T 9 -f -t -G -s poly2bitmap -s storeallcharacters ${fileIn} -o ${fileOut} |
Segmentation fault (core dumped)
Section titled “Segmentation fault (core dumped)”This is a log of a segmentation fault error:
/home/openkm/tomcat-8.5.69/bin/pdf2swf -f -T 9 -t -s storeallcharacters input.pdf -o output.swfNOTICE processing PDF page 1 (878x1105:0:0) (move:0:0)NOTICE File contains formsNOTICE File contains pbm picturesNOTICE File contains soft masksWARNING multiply blended transparency groups not yet supported!NOTICE File contains transparency groupsSegmentation fault (core dumped)You can try the -s poly2bitmap or -s bitmap arguments. In our experience, the bitmap option is more reliable for fixing display issues, but of course it may decimate text and, in some cases, increase file size and processing time. You can also add the -s multiply=4 bitmap argument to get a really crisp bitmap output, further increasing size and processing time, but getting you pretty close to the original PDF.
/home/openkm/tomcat-8.5.69/bin/pdf2swf -f -T 9 -t -s bitmap -s storeallcharacters input.pdf -o output.swfNOTICE processing PDF page 1 (878x1105:0:0) (move:0:0)NOTICE Writing SWF file output.swfError with copy-protected PDF
Section titled “Error with copy-protected PDF”Perhaps the PDF is copy-protected. Therefore, you’re not allowed to convert it.
If you created this PDF using Acrobat Distiller, try switching the copy protection checkbox off. If you can’t disable the protection, you can modify the ‘pdf2swf’ source code to disable this check (see http://www.foolabs.com/xpdf/cracking.html).