Ir al contenido
Otras versiones

Cargando…

Configuring SWFTools

Esta página aún no está disponible en tu idioma.

By default the application comes with tomcat bundled with SWFTools that is pre-configured.

Terminal window
sudo add-apt-repository ppa:guilhem-fr/swftools
sudo apt-get update
sudo apt-get install swftools

For better performance, use the following configuration.

Property Description
system.swftools.pdf2swf Pdf2swf tool 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, improves searchability in the document
  • -t : Inserts a stop between each frame, improves stability
  • -G : Makes the document smaller and faster to render
  • -s storeallcharacters : Stores all character information about the texts in the document, improves searchability

It is better to compile version 0.9.x

Terminal window
yum install zlib-devel libjpeg-devel giflib-devel freetype-devel gcc gcc-c++
wget http://www.swftools.org/swftools-0.9.1.tar.gz
tar xzf swftools-0.9.1.tar.gz
cd swftools-0.9.1
./configure --prefix=/usr/local
make
make install

For better performance, use the following configuration.

Property Description
system.swftools.pdf2swf Pdf2swf tool 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, improves searchability in the document
  • -t : Inserts a stop between each frame, improves stability
  • -G : Makes the document smaller and faster to render
  • -s storeallcharacters : Stores all character information about the texts in the document, improves searchability

This package is not include in the Debian repositories, so you need to compile from source:

Terminal window
aptitude install build-essential libgif-dev xpdf libfreetype6 libfreetype6-dev libjpeg62 libjpeg8 libjpeg8-dev
wget http://www.swftools.org/swftools-0.9.1.tar.gz
tar xzf swftools-0.9.1.tar.gz
cd swftools-0.9.1
./configure --prefix=/usr/local
make
make install

For better performance, use the following configuration.

Property Description
system.swftools.pdf2swf Pdf2swf tool 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, improves searchability in the document
  • -t : Inserts a stop between each frame, improves stability
  • -G : Makes the document smaller and faster to render
  • -s storeallcharacters : Stores all character information about the texts in the document, improves searchability

Download the latest Swftools from http://www.swftools.org/download.html and install it (for example at c:\tomcat-7.0.61\tools\swftools).

For better performance, use the following configuration.

Property Description
system.swftools.pdf2swf Pdf2swf tool used to convert PDF documents to swf.
c:\tomcat-7.0.61\tools\swftools\pdf2swf.exe -T 9 -f -t -G -s storeallcharacters ${fileIn} -o ${fileOut}

The parameters specifies that:

  • -f : Fonts should be embedded, improves searchability in the document
  • -t : Inserts a stop between each frame, improves stability
  • -G : Makes the document smaller and faster to render
  • -s storeallcharacters : Stores all character information about the texts in the document, improves searchability

If the document is large (has many pages) or is complex, the conversion may fail with this error:

You can workaround this error adding the -s poly2bitmap parameter which convert graphics to bitmaps:

Property Description
system.swftools.pdf2swf /usr/bin/pdf2swf -T 9 -f -t -G -s poly2bitmap -s storeallcharacters ${fileIn} -o ${fileOut}

This is a log of a segmentation fault error:

Terminal window
/home/openkm/tomcat-7.0.61/bin/pdf2swf -f -T 9 -t -s storeallcharacters input.pdf -o output.swf
NOTICE  processing PDF page 1 (878x1105:0:0) (move:0:0)
NOTICE  File contains forms
NOTICE  File contains pbm pictures
NOTICE  File contains soft masks
WARNING multiply blended transparency groups not yet supported!
NOTICE  File contains transparency groups
Segmentation fault (core dumped)

You can try the -s poly2bitmap or -s bitmap arguments. In our experience it seems the bitmap option is more reliable for fixing display issues, but of course you decimate any text, and in some cases increases file size and processing time. You can also add the -s multiply=4 the bitmap argument to get a really crisp bitmap output further increasing size and processing time, but gets you pretty close to the original PDF.

Terminal window
/home/openkm/tomcat-7.0.61/bin/pdf2swf -f -T 9 -t -s bitmap -s storeallcharacters input.pdf -o output.swf
NOTICE  processing PDF page 1 (878x1105:0:0) (move:0:0)
NOTICE  Writing SWF file output.swf

Perhaps the PDF is copy protected. Hence, 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).