• DOC/DOCX preview

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #7679  by andi.teodorescu
 
I've made it to work with PDFs but I can't get doc/docx previews working.

I have OO installed
Code: Select all
openoffice.org-base.i386                    1:3.1.1-19.5.el5_5.1       installed
openoffice.org-calc.i386                    1:3.1.1-19.5.el5_5.1       installed
openoffice.org-core.i386                    1:3.1.1-19.5.el5_5.1       installed
openoffice.org-draw.i386                    1:3.1.1-19.5.el5_5.1       installed
openoffice.org-graphicfilter.i386           1:3.1.1-19.5.el5_5.1       installed
openoffice.org-headless.i386                1:3.1.1-19.5.el5_5.1       installed
openoffice.org-impress.i386                 1:3.1.1-19.5.el5_5.1       installed
openoffice.org-javafilter.i386              1:3.1.1-19.5.el5_5.1       installed
openoffice.org-math.i386                    1:3.1.1-19.5.el5_5.1       installed
openoffice.org-ure.i386                     1:3.1.1-19.5.el5_5.1       installed
openoffice.org-writer.i386                  1:3.1.1-19.5.el5_5.1       installed
openoffice.org-xsltfilter.i386              1:3.1.1-19.5.el5_5.1       installed
Code: Select all
[root@dev jboss-4.2.3.GA]# netstat -nap | grep office
tcp        0      0 127.0.0.1:8100              0.0.0.0:*                   LISTEN      3223/soffice.bin
unix  2      [ ACC ]     STREAM     LISTENING     11746  3223/soffice.bin    /tmp/OSL_PIPE_0_SingleOfficeIPC_b919ef148f655fcebc4bf633c062a098
Started by:
Code: Select all
[root@dev jboss-4.2.3.GA]# cat /etc/init.d/soffice
#!/bin/bash
# chkconfig: 345 20 80
# description: init.d script for headless openoffice.org (2.3+ for RHEL5 32bit)
#
# processname: soffice
#
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
SOFFICE_PATH='/usr/lib/openoffice.org3/program'
SOFFICE_ARGS='-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager -headless -nofirststartwizard -nologo'
SOFFICE_PIDFILE=/var/run/soffice.bin.pid

start_soffice() {
       echo -n $"Starting OpenOffice.org"
       $SOFFICE_PATH/soffice.bin $SOFFICE_ARGS >/dev/null 2>&1 &
       [ $? -eq 0 ] && echo_success || echo_failure
       pidof soffice.bin > $SOFFICE_PIDFILE
       echo
}
start() {
       start_soffice
}
stop() {
       echo -n $"Stopping OpenOffice"
       killproc soffice
       echo
}
case "$1" in
       start)
               start
               ;;
       stop)
               stop
               ;;
       restart)
               stop
               start
               ;;
       *)
               echo $"Usage: $0 {start|stop|restart}"
esac
OpenKM.cfg:
Code: Select all
[root@dev jboss-4.2.3.GA]# cat OpenKM.cfg
# Default configuration values
#
# repository.config=repository.xml
# repository.home=repository
# system.user=system
# default.user.role=UserRol
# default.admin.role=AdminRol
# principal.adapter=com.openkm.core.UsersRolesPrincipalAdapter
# max.file.size=5
# max.search.results=25
# system.demo=off
system.openoffice=/usr/lib/openoffice.org3
system.pdf2swf=/usr/local/bin/pdf2swf
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl=none
Code: Select all
drwxrwxrwx 4 root root  4096 Dec 21 15:27 cache
OpenKM is running on HTTPS:8443, started with
Code: Select all
bin/run.sh -b 0.0.0.0
Am I missing something?
Last edited by andi.teodorescu on Wed Dec 22, 2010 1:45 pm, edited 2 times in total.
 #7692  by andi.teodorescu
 
Fixed, with the help of two recent posts in different thread (http://forum.openkm.com/viewtopic.php?f=4&t=4227#p7688).
yfzhou72 wrote:Issue sovled.

Change the setting as following:

old: not work
system.openoffice=c:\\program files\\openoffice.org 3\\

new: workable
system.openoffice.path=c:\\program files\\openoffice.org 3\\
system.openoffice.port=8100

but the setting is different from the documents.
pavila wrote:You are right, this was a late time feature migrated from develop branch to 5.0 and was not well documented. I've updated the wiki.
 #7696  by andi.teodorescu
 
Still, DOCX is not working.. while XLSX are fine.
Also I JPEG images are not working while GIF & PNG do.

For DOCX I get: Document URL not provided or invalid
As for JPEG I get the swf with: There was a problem with the preview generation. Please, contact your OpenKM administrator.
Code: Select all
WARN  [DocConverter] STDERR: Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

16:10:47,683 ERROR [OKMDownloadServlet] /opt/jboss-4.2.3.GA/cache/swf/e339a1f4-41de-4189-a5e0-5d2834f040b3.swf (No such file or directory)
java.io.FileNotFoundException: /opt/jboss-4.2.3.GA/cache/swf/e339a1f4-41de-4189-a5e0-5d2834f040b3.swf (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:137)
        at com.openkm.frontend.server.OKMDownloadServlet.service(OKMDownloadServlet.java:171)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
16:10:55,081 ERROR [DocConverter] Error in application/vnd.openxmlformats-officedocument.wordprocessingml.document to PDF conversion
16:10:55,082 ERROR [OKMDownloadServlet] Error in application/vnd.openxmlformats-officedocument.wordprocessingml.document to PDF conversion
java.io.IOException: Error in application/vnd.openxmlformats-officedocument.wordprocessingml.document to PDF conversion
        at com.openkm.util.DocConverter.doc2pdf(DocConverter.java:194)
        at com.openkm.frontend.server.OKMDownloadServlet.service(OKMDownloadServlet.java:145)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.IOException: Error converting document: could not load document: okm1573281674590027193.doc
        at com.openkm.util.DocConverter.convert(DocConverter.java:170)
        at com.openkm.util.DocConverter.doc2pdf(DocConverter.java:189)
        ... 21 more
16:10:55,084 ERROR [[OKMDownloadServlet]] Servlet.service() for servlet OKMDownloadServlet threw exception
com.openkm.frontend.client.OKMException: Error in application/vnd.openxmlformats-officedocument.wordprocessingml.document to PDF conversion
        at com.openkm.frontend.server.OKMDownloadServlet.service(OKMDownloadServlet.java:193)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
 #7701  by jllort
 
I've not seen imagemagick and swftools in your OpenKM.cfg
 #7703  by andi.teodorescu
 
Not in the config I posted.

DOCX are fixed, I've removed openoffice given by CentOS repo and installed latest version from their site. The PDF generated was damaged.

ImageMagick and swftools are installed and configured but it works only for PNG&GIFs.
 #7715  by jllort
 
Try converting document directly with open office to see if it runs well there. With which ms office version have you generated docx ? 2010 is not good idea probably
 #7723  by andi.teodorescu
 
jllort wrote:Try converting document directly with open office to see if it runs well there. With which ms office version have you generated docx ? 2010 is not good idea probably
Like I said, DOCX are working fine now with OO 3.2 and yes, I've been using Office 2010.

JPEG & TXT is still not working...
Code: Select all
[root@dev jboss-4.2.3.GA]# cat OpenKM.cfg
# Default configuration values
#
# repository.config=repository.xml
# repository.home=repository
# system.user=system
# default.user.role=UserRol
# default.admin.role=AdminRol
# principal.adapter=com.openkm.core.UsersRolesPrincipalAdapter
# max.file.size=5
# max.search.results=25
# system.demo=off
system.ocr=/usr/bin/tesseract
#system.img2pdf=/usr/bin/convert
system.img2pdf=/root/ImageMagick-6.6.6-6/utilities/convert
system.openoffice.path=/opt/openoffice.org3
system.openoffice.port=8100
system.pdf2swf=/usr/local/bin/pdf2swf
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl=none
Code: Select all
[root@dev jboss-4.2.3.GA]# convert
Version: ImageMagick 6.2.8 10/20/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
JPEG error:
Code: Select all
15:01:49,920 WARN  [DocConverter] Abnormal program termination: {}1
15:01:49,921 WARN  [DocConverter] STDERR: Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

15:01:49,921 ERROR [OKMDownloadServlet] /opt/jboss-4.2.3.GA/cache/swf/8ee55b39-a0fa-4a0d-91cd-147bb1570e93.swf (No such file or directory)
java.io.FileNotFoundException: /opt/jboss-4.2.3.GA/cache/swf/8ee55b39-a0fa-4a0d-91cd-147bb1570e93.swf (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:137)
        at com.openkm.frontend.server.OKMDownloadServlet.service(OKMDownloadServlet.java:171)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
 #7736  by jllort
 
There's some problem on conversion as seen in log
Code: Select all
15:01:49,920 WARN  [DocConverter] Abnormal program termination: {}1
15:01:49,921 WARN  [DocConverter] STDERR: Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table
We might try executing conversion jpg to pdf directly from command line to see if there runs ok.
 #7964  by jap_td03
 
i've got a problem witth DOC/DOCX preview. sometime and some files are able to preview well but some else not. i've got error "Document url not provided or invalid"

Please help!

thanks
 #7987  by jllort
 
With the files you've got problems, could try preview on our online demo. And secondly which message appears in your server.log when you try to previewing ?
Are thouse documents opened with open office and converted to pdf ?
 #7991  by jap_td03
 
Thanks for your reply.

Server.log:
Code: Select all
2011-01-14 23:49:11,495 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM].[OKMDownloadServlet]] Servlet.service() for servlet OKMDownloadServlet threw exception
com.openkm.frontend.client.OKMException: Error in application/vnd.openxmlformats-officedocument.wordprocessingml.document to PDF conversion
	at com.openkm.frontend.server.OKMDownloadServlet.service(OKMDownloadServlet.java:193)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Unknown Source)
i've try to preview .docx files. some files are ok but errors "Documment URL is not provided or invalid" appears when trying preview with some others. I've also try with the Demo but got same errors (many .doc files on Demo are not be previewed).
 #7993  by jllort
 
For what appearing on server.log the problem is on doc to pdf conversion service by open office. Seems don't likes the document to be converted. Could you try with one of that documents opening directly with open office and covert to pdf. That documents are microsoft office 2010 no ? The problem could be is so newer format for open office ( could you try saving as 2007 version ).
 #8270  by pavila
 
I think DOCX support is only available from OpenOffice.org 3.2.x, but not in 3.1.x. Try to open this kind of file from OpenOffice. Also note that OpenKM 4.1 can't preview DOCX with independence of the OpenOffice version.
 #8286  by jap_td03
 
jllort wrote:For what appearing on server.log the problem is on doc to pdf conversion service by open office. Seems don't likes the document to be converted. Could you try with one of that documents opening directly with open office and covert to pdf. That documents are microsoft office 2010 no ? The problem could be is so newer format for open office ( could you try saving as 2007 version ).
I am using office 2010. OpenOffice work well with this file.
i also save as it into previous Word version but nothing changed.
 #8386  by pavila
 
Can you try this problematic file with the online OpenKM demo? You can also try the OpenKM 5.0.1 nightbuild with has some document conversion ehancements.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.