• Preview 4.1 versus 5.0

  • 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.
 #6958  by JanB
 
On the risc that this has ever been posted before :)
I'm a total nitwit at the linux site but i'm a little bit moving to it.
But at this moment i'm chained to the windows environment
Question mentioned below is tested on a windows server 2003 environment

Preview in 4.1 works fine but with the same configuraration in 5.0 it results in "Document url not provided or invalid"
Is there a change in 5.0 in the way how previews are handled?
PDF is recognized flawlesly but "doc" and "xls" has problems

system
windows server 2003
openoffice is running and listening on port 8100
OpenKm is running and listening on port 8080 (and others as specified in the installations guide)

OpenKM.cfg
system.openoffice=on
system.pdf2swf=C:\openkm50\bin\pdf2swf

Folders
openoffice directory = C:\Program Files\openoffice
SWFTools directory = C:\Program Files\SWFTools
OpenKM directory = C:\openkm50

However
Looking at the start-up sequence version 5.0 don't seems to recognize the openoffice directory (
Adding system.openoffice=C:\Program Files\openoffice to the cfg file has no result
Code: Select all
04:51:22,562 WARN  [RepositoryStartupServlet] officeHome must exist and be a directory
java.lang.IllegalArgumentException: officeHome must exist and be a directory
I think i'm missing the catch but after spending two weeks to find it i give up

Pls guide me in providing more details before posting total listings (which are available ofcourse)
 #6959  by jllort
 
Try with these:
Code: Select all
 openoffice directory = C:/Program Files/openoffice
 SWFTools directory = C:/Program Files/SWFTools/pdf2swf.exe
These are java uri path to file system, normally it's better using / ( tell us if it solves the problem ).

Using latest open office is strong recommended, in more older open office could be some problem during conversion ( new ms office formats, and some very very small text files with few bytes)
 #6960  by JanB
 
Hi

Thanks for your quick reply
Playing with slash and backslash don't give any improvement.
I have done that for the last two weeks
The best improvement i have seen was , when i switched over fromSWFTools/pdf2swf.exe to the pdf2swf file in the openkm/bin folder
I have seen previews from pdf and ppt for none of the doc and xls type
i have installed the latest openoffice version (downloaded 7 days ago, version 3.1 i think)

i'm just very curious why it works smoothly with OKM 4.1 and not with 5.0

attached the cfg file , maybe there is something really wrong in it
Code: Select all
# 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
restrict.file.mime=off
restrict.file.extension=*~,*.bak,._*
#system.ocr=/usr/bin/tesseract
system.openoffice=C:/Program Files/openoffice
system.openoffice=on
#system.img2pdf=/usr/bin/convert
system.pdf2swf=C:/Program Files/SWFTools/pdf2swf.exe
#system.pdf2swf=C:/openkm50/bin/pdf2swf
#system.antivir=/usr/bin/clamscan
hibernate.hbm2ddl=none
#application.url=http://localhost:8080/OpenKM/com.openkm.frontend.Main/index.jsp
max.file.size=060520010
#principal.adapter=com.openkm.principal.DatabasePrincipalAdapter
 #6965  by jllort
 
remove the system.openoffice=on you can not get two system.openoffice= in same OpenKM.cfg probably second overwrites first.

If you go on administration tab you'll see the real OpenKM.cfg properties loaded ( second or third buttom from left, I don't remember exactly ). Now system.openoffice=on it's not needed in version 5.x the system.openoffice= really must have the path.

Tell us if it solves the problem ?
 #6976  by JanB
 
Hi,

Followed your instuctions to disable system.openoffice=on.
This was part of the partly solution

attached
- Openkm.cfg
- error list of cmd window

- After disabling system.openoffice=on OpenKM was able to logon to the openoffice service at port 2002
path to openoffice directory corrected according to your recommendations)
- OpenKM seems not to be work very well with the internal pdf2swf (only on pdf and doc files)
so i have switched over to the SWFTools pdf2swf.exe solution.
In openkm 4.1 the internal pdf2swf worked very well for ALL documents
SWFTools is working for all except for xls files with multiple sheets
For this kind of files it is creating an error (see error list)

So we are 1 step closer to the final solution
Is there also a solution to the multiple sheets issue?

In general : OpenKM 5.0 is much slower compared to OpenKM 4.1 when its is running on a slower processor
I hope this will be solved in the final release

Errorlist when opening excel file with multiple sheets
Code: Select all
17:15:01,812 ERROR [DocConverter] Error in application/vnd.ms-excel to PDF conversion
17:15:01,812 ERROR [STDERR] 2-nov-2010 17:15:01 org.artofsolving.jodconverter.office.OfficeProcess forciblyTerminate
INFO: trying to forcibly terminate process: 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1' (pid 4700)
17:15:01,812 ERROR [OKMDownloadServlet] Error in application/vnd.ms-excel to PDF conversion
java.io.IOException: Error in application/vnd.ms-excel to PDF conversion
        at com.openkm.util.DocConverter.doc2pdf(DocConverter.java:189)
        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(Unknown Source)
Caused by: java.io.IOException: Error convertind document: task did not complete within timeout
        at com.openkm.util.DocConverter.convert(DocConverter.java:165)
        at com.openkm.util.DocConverter.doc2pdf(DocConverter.java:184)
        ... 21 more
17:15:01,875 ERROR [[OKMDownloadServlet]] Servlet.service() for servlet OKMDownloadServlet threw exception
com.openkm.frontend.client.OKMException: Error in application/vnd.ms-excel 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)
OpenKM.cfg
Code: Select all
# 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
restrict.file.mime=off
restrict.file.extension=*~,*.bak,._*
#system.ocr=/usr/bin/tesseract
system.openoffice=C:/Program Files/openoffice
#system.openoffice=on
#system.img2pdf=/usr/bin/convert
system.pdf2swf=C:/Program Files/SWFTools/pdf2swf.exe
#system.pdf2swf=C:/openkm50/bin/pdf2swf
#system.antivir=/usr/bin/clamscan
hibernate.hbm2ddl=none
#application.url=http://localhost:8080/OpenKM/com.openkm.frontend.Main/index.jsp
max.file.size=060520010
#principal.adapter=com.openkm.principal.DatabasePrincipalAdapter
 #6979  by jllort
 
Can you load document in openoffice and converting to xls
Could you try the same document in our online demo ?
 #6988  by JanB
 
Description of xls file
XLS files are excel files with multiple sheets inside
Converted they will be approx 100 pdf sheets
size of xls file approx 1.5 mb

converted to ODF format they will load fluently
When loading into openoffice i got some warnings about active-x addings and macro's
Saving to xls into openoffice has no improvement

Loading into the demo will cause a white screen into the preview window showing page 1/1
this is more than i get into the live running program
 #6992  by jllort
 
The question is when you loading into openoffice can be converted to pdf ? because really it's what really are doing in background.
 #7035  by JanB
 
Hi

Sorry for my late reply, but i was little bit ill last days

answering your question, yes open office will create the requested PDF.
But i have to approve the "macro warning"

I have tried to create the output in OpenKM by setting the macro security to "LOW" but the same result.
Still i'm thinking this is a weird one because it was functioning in 4.1 for the same document
 #7039  by jllort
 
could you send to us some document for testing ? if we can reproduce we can solve it.
 #7570  by jllort
 
I've tested the original file you send me and I can not preview in my environment too. Then I edit the file, I make only two changes, removes the rest of the sheet and only get the first and change some font type to arial or similar ( now I don't remember which font I use ), then the preview runs well.

In online demo we've got older open office version, reason why chinese character is not seen right, but in my server runs well.

The origin of the problem is on pdf conversion. Curiously your file and mine are right converted if you open with open office. But using open office as service seems only the second is converted right. I've got no reason now for this strange problem. But sure the problem is on xls to pdf ( as you can see in cache folder the tmp pdf doc is not right converted ).
 #7578  by wangmj
 
it's really a strange problem!
documents suffix in (txt/html/xls ) can't preview! doc/ppt/xlsx etc support preview!
After testing ,I found a way to resolve the problem.
Code: Select all
	/**
	 * Convert document to PDF.
	 */
	public void doc2pdf(InputStream is, String mimeType, File output) throws IOException {
		log.debug("** Convert from {} to PDF **", mimeType);
		String docSuffix = ".doc";
		//added by wangmj  html,txt,xls全部能够预览了!
		if("application/msword".equals(mimeType)){
			docSuffix=".doc";
		}else if("application/vnd.ms-excel".equals(mimeType)){//excel必须使用正确的后缀
			docSuffix=".xls";
		}else  if("application/vnd.ms-powerpoint".equals(mimeType)){
			docSuffix=".ppt";
		}else if("text/html".equals(mimeType)){
			docSuffix=".html";
		}else if("text/plain".equals(mimeType)){
			docSuffix=".txt";
		}else {
			docSuffix = ".doc";
		}
		
		File tmp = File.createTempFile("okm", docSuffix);
		FileOutputStream fos = null;
		
		try {
			long start = System.currentTimeMillis();
			fos = new FileOutputStream(tmp);
			IOUtils.copy(is, fos);
			fos.flush();
			fos.close();
			
			convert(tmp, mimeType, output);
			log.debug("Elapse doc2pdf time: {}", FormatUtil.formatSeconds(System.currentTimeMillis() - start));
		} catch (Exception e) {
			log.error("Error in {} to PDF conversion", mimeType, e);
			output.delete();
			throw new IOException("Error in "+mimeType+" to PDF conversion", e);
		} finally {
			IOUtils.closeQuietly(fos);
			tmp.delete();
		}
	}
 #7843  by pavila
 
I have made some changes in document conversion logic as requested by wangmj. You can test these improvements with OpenKM 5.0.1-SNAPSHOT nightbuild. Don't try it on a production environment. I expect your feedback.

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.