Can't preview word documents, PDF2swf fails

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Wed Mar 15, 2017 2:31 pm

Can't preview word documents, PDF2swf fails

Post by dxider » Wed Mar 15, 2017 5:39 pm

Basically, I'm having problems to be able to preview word documents.
When the server tries to perform the pdf2swf conversion, there are several error in the application log.

This is an extract of the log:

Code: Select all

2017-03-14 23:50:37,662 [http-apr-] INFO com.openkm.spring.LoggerListener- Authentication ERROR: okAdmin
2017-03-14 23:51:15,850 [http-apr-] INFO com.openkm.vernum.VersionNumerationFactory- VersionNumerationAdapter: com.openkm.vernum.MajorMinorVersionNumerationAdapter
2017-03-14 23:53:31,398 [http-apr-] WARN com.openkm.util.ExecutionUtils- Abnormal program termination: 1
2017-03-14 23:53:31,398 [http-apr-] WARN com.openkm.util.ExecutionUtils- CommandLine: [C:/tomcat/bin/pdf2swf.exe, -T, 9, -f, c:\tomcat\repository\cache\pdf\3fd264e9-8cfa-43e7-8ac4-1ee5b289af4b.pdf, -o, c:\tomcat\repository\cache\swf\3fd264e9-8cfa-43e7-8ac4-1ee5b289af4b.swf]
2017-03-14 23:53:31,398 [http-apr-] WARN com.openkm.util.ExecutionUtils- STDERR: 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
What I've seen so far, is that parameter mapping is failing, because as you can see, each parameter passed to the CommandLine is separated with commas, instead of just spaces, this is the configuration setting I have:

Code: Select all

C:/tomcat/bin/pdf2swf.exe -T 9 -f ${fileIn} -o ${fileOut}
[See attached picture with configuration and error]
So, the CommandLine must parse something like this:

Code: Select all

 [C:/tomcat/bin/pdf2swf.exe -T 9 -f c:\tomcat\repository\cache\pdf\3fd264e9-8cfa-43e7-8ac4-1ee5b289af4b.pdf -o c:\tomcat\repository\cache\swf\3fd264e9-8cfa-43e7-8ac4-1ee5b289af4b.swf]
I don't know why the server add the extra "commas" to the command line, making it fail.
I'm working with a Windows 2012 Server R2.
Error log

Posts: 9119
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain

Re: Can't preview word documents, PDF2swf fails

Post by jllort » Thu Mar 16, 2017 12:13 pm

Take a look here ... leshooting I think the solution could be changing the actual pdf2swf parameters

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest