Page 1 of 1

Can't preview word documents, PDF2swf fails

PostPosted:Wed Mar 15, 2017 5:39 pm
by dxider
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-0.0.0.0-8082-exec-2] INFO com.openkm.spring.LoggerListener- Authentication ERROR: okAdmin
2017-03-14 23:51:15,850 [http-apr-0.0.0.0-8082-exec-1] INFO com.openkm.vernum.VersionNumerationFactory- VersionNumerationAdapter: com.openkm.vernum.MajorMinorVersionNumerationAdapter
2017-03-14 23:53:31,398 [http-apr-0.0.0.0-8082-exec-10] WARN com.openkm.util.ExecutionUtils- Abnormal program termination: 1
2017-03-14 23:53:31,398 [http-apr-0.0.0.0-8082-exec-10] 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-0.0.0.0-8082-exec-10] 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.

Re: Can't preview word documents, PDF2swf fails

PostPosted:Thu Mar 16, 2017 12:13 pm
by jllort
Take a look here https://docs.openkm.com/kcenter/view/ok ... leshooting I think the solution could be changing the actual pdf2swf parameters