Third-party software integration: SWFTools

From OpenKM Documentation
Revision as of 10:34, 21 March 2012 by Pavila (talk | contribs) (Improving performance)

Jump to: navigation, search

To enable preview UI tab, OpenKM need to convert pdf files to swf.


Nota advertencia.png Starting from OpenKM 5.1 this configuration property has changed to system.swftools.pdf2swf.


Nota clasica.png Since OpenKM 5.1.9 the pdf2swf command line parameters should be added in the configuration property, for example:
 system.swftools.pdf2swf=/usr/bin/pdf2swf -T 9 -f ${fileIn} -o ${fileOut}

See FlexPaper: Converting Documents for more info.

Linux

Ubuntu

Swftools can be installed running in terminal:

$ sudo aptitude install swftools

Enable in OpenKM.cfg or Administration > Configuration depending on your OpenKM version:

system.swftools.pdf2swf=/usr/bin/pdf2swf

Nota clasica.png In Ubuntu 10.04 is possible you need to add this line to /etc/apt/sources.list
deb http://archive.canonical.com/ubuntu lucid partner


Nota clasica.png In Ubuntu 10.10 this package is not included, so you need to compile it or grab from https://launchpad.net/~ella-animation/+archive/dev:
 $ sudo add-apt-repository ppa:ella-animation/dev
 $ sudo aptitude update
 $ sudo aptitude install swftools

Red hat

Better if you 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.gz
$ tar xzf swftools-0.9.1.tar.gz
$ cd swftools-0.9.1
$ ./configure --prefix=/usr/local
$ make
$ make install 

Debian

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

$ 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 

Or you can try to install the Ubuntu package. For Debian Squeeze I recommend the Ubuntu Lucid package.

Improving performance

For better performance, use this configuration.

 system.swftools.pdf2swf=/usr/bin/pdf2swf -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

OpenKM 5.0.x

Create file pdf2swf_wrapper.sh

#!/bin/bash

/usr/bin/pdf2swf $* -f -t -G -s storeallcharacters

Make it executable:

$ chmod +x pdf2swf_wrapper.sh

And don't forget to change the OpenKM.cfg file:

system.pdf2swf=/path/to/pdf2swf_wrapper.sh

Nota clasica.png Take a look at pdf2swf wiki for complete parameters reference, and remember that JBoss must be restarted after every OpenKM.cfg modification.

See also Troubleshooting: Some PDF file not shown in preview.

Windows

Donwload last swftools http://www.swftools.org/download.html and install it.

Enable in OpenKM.cfg ( put this character to indicate path separator "/" not "\" )

system.pdf2swf=c:/program files/swftools/pdf2swf.exe

Improving performance

For better performance in conversion,

 system.swftools.pdf2swf=c:/path/to/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

OpenKM 5.0.x

Create file pdf2swf_wrapper.bat

c:\path\to\pdf2swf %1 %2 %3 -f -t -G -s storeallcharacters

And don't forget to change the OpenKM.cfg file:

system.pdf2swf=c:/path/to/pdf2swf_wrapper.bat

Nota clasica.png Take a look at pdf2swf wiki for complete parameters reference, and remember that JBoss must be restarted after every OpenKM.cfg modification.

See also Troubleshooting: Some PDF file not shown in preview.