Page 1 of 1

"Download as PDF" produces a SWF file

PostPosted:Tue Nov 13, 2012 2:47 pm
by zio_tom78
Hi to everybody,

I'm running OpenKM 6.2 under Ubuntu Linux 12.04. This is the Java version I'm using:
Code: Select all
$ java -version
java version "1.7.0_09"
OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.10.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
With this configuration OpenKM runs fine, but there are two problems with my current configuration:
  • Previewing PDF files takes forever and does not show anything
  • Previewing OpenOffice files produces the following error message:
    Code: Select all
    Conversion: Error: May not be a PDF file (continuing anyway)
    Error: PDF file is damaged - attempting to reconstruct xref table...
    Error: Couldn't find trailer dictionary
    Error: Couldn't read xref table
  • The button "Download as PDF" saves a file with extension .pdf which is however a Shockwave Flash file:
    Code: Select all
    $ file lspe_sbf_scientific_requirements.pdf
    lspe_sbf_scientific_requirements.pdf: Macromedia Flash data (compressed), version 6
    
(I've attached the file catalina.log for reference - I turned the log level for log4j.logger.com.openkm.util to DEBUG).

I've set up OpenKM via "Administration > Configuration", the relevant settings are the following:
Code: Select all
system.previewer=flexpaper
system.openoffice.path="/usr/lib/libreoffice/"
system.openoffice.port=2002	    
system.openoffice.tasks=200
system.swftools.pdf2swf="/opt/tomcat/bin/pdf2swf -T 9 -f ${fileIn} -o ${fileOut}"
I had to manually fill the entry "system.swftools.pdf2swf" because it was empty, it took me some time to understand how to format it (I had to dig into OpenKM's source code to discover fileIn and fileOut - is this documented somewhere in the wiki?). I installed LibreOffice using Ubuntu's apt-get, and the executable is indeed /usr/lib/libreoffice/program/soffice.bin. Also, running pdf2swf from the command line using the full path above is ok.

Note that I'm able to solve at least the first problem (previewing PDF hangs the system forever) by change system.previewer from flexpaper to zviewer. But the other two problems still remain.

Has any of you some ideas about where I might look for hints? The log file has not helped me in spotting the cause of the problem.

Thanks very much,
Maurizio.

Re: "Download as PDF" produces a SWF file

PostPosted:Wed Nov 14, 2012 2:58 am
by okmuser
Hi,

I don't think OpenKM 6.2 is fully Java 1.7 compatible.

Can you check whether you have the same issues with Java JDK 1.6_37.

The pdf2swf has to be completed by the admin user as it is depending on the system you are using (Linux/Windows/BSD).

And it is mentioned here:

http://wiki.openkm.com/index.php/Third- ... :_SWFTools

Re: "Download as PDF" produces a SWF file

PostPosted:Wed Nov 14, 2012 10:16 am
by zio_tom78
okmuser wrote:Hi,

I don't think OpenKM 6.2 is fully Java 1.7 compatible.

Can you check whether you have the same issues with Java JDK 1.6_37.
I'm sorry, yesterday I mistakenly checked Java's version on my laptop instead of the server running OpenKM. The JDK running there is indeed 1.6:
Code: Select all
$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
okmuser wrote:The pdf2swf has to be completed by the admin user as it is depending on the system you are using (Linux/Windows/BSD).

And it is mentioned here:

http://wiki.openkm.com/index.php/Third- ... :_SWFTools
Thanks for the link. I completely missed it.

Re: "Download as PDF" produces a SWF file

PostPosted:Mon Nov 26, 2012 12:29 pm
by miguelromero
You must make sure OpenKM is compiling and opening with 1.6 Java version. Also if you are still having some convert/preview problems, you must clear the OpenKM cache for converted documents, where you will find some garbage non valid documents which may cause conflict.
Code: Select all
\tomcat\repository\cache

Re: "Download as PDF" produces a SWF file

PostPosted:Thu Nov 29, 2012 12:47 pm
by jllort
For what I understand when you click on donwload button you get swf file not pdf. Which kind of file are you trying to convert ? can you test it in our online demo if error is present theere too ?

Re: "Download as PDF" produces a SWF file

PostPosted:Fri Dec 07, 2012 4:34 pm
by pavila
Try to clean cached conversions:
Code: Select all
$ rm -rf $TOMCAT_HOME/repository/cache/pdf/*
$ rm -rf $TOMCAT_HOME/repository/cache/swf/*

Re: "Download as PDF" produces a SWF file

PostPosted:Tue Oct 22, 2013 7:47 am
by alberttong
okmuser wrote:Hi,

I don't think OpenKM 6.2 is fully Java 1.7 compatible.

Can you check whether you have the same issues with Java JDK 1.6_37.

The pdf2swf has to be completed by the admin user as it is depending on the system you are using (Linux/Windows/BSD).

And it is mentioned here:

http://wiki.openkm.com/index.php/Third- ... :_SWFTools

or you could also choose to use XFlip pdf to swf flip book tool to accomplish this.
ok, you mean converting PDF to swf file, you could try to find the solution by google search!