• Improve preview of MS Office documents

  • Help us to improve OpenKM! Be part of the Open Source Community.
Help us to improve OpenKM! Be part of the Open Source Community.
Forum rules: Please, before asking something see the documentation wiki or use the forum search function.
 #40774  by mkwong98
 
Hi, as the generation of pdf for preview is not 100% accurate, I suggest modifying the MS Add-on to generate the preview pdf if the MS Office support it and upload it at the same time as the document itself. I also suggest allowing the user to manually upload a preview pdf too. This way, it is possible to by pass the inaccurate preview pdf generation and use the pdf generated by MS Office. Thank you.
 #40783  by jllort
 
The solution you propose will not solve anything ( from openkm side you still need converting pdf to swf ). This topic is the same than another topic you have yet opened, I suggest do not open new topics for same issue and continues with the first opened.

Note: I'm not sure if community version has the option - at profiles - of embeded preview, what will use acrobat reader plugin in browser for previewing and will not cause to you the conversion problem. Take a look on profiles at general tab.
 #40788  by mkwong98
 
The problem that I have is that openoffice/libreoffice cannot render those files accurately to pdf to begin with:

1. the same formatting problem in the preview appears when I open those doc/xls/ppt files with openoffice/libreoffice.
2. pdf files generated by MS office do not have that problem and the preview of those pdf files also do no have the problem.

So the problem happens during the doc/xls/ppt to pdf step, and as far as I can tell, the converting pdf to swf works perfectly. That is why I propose to bypass openoffice/libreoffice if the computer uploading the file already has MS office.

So please reconsider my suggestion, thanks.
 #40793  by pavila
 
According to your proposal, how do we convert Office documents to PDF? The previewer need the document in PDF or SWF format.
 #40796  by mkwong98
 
I suggest two ways of doing it:
1. If it is uploaded using the MS Office add-on then automatically convert it to PDF at the same time as uploading the file
2. Allow the user to manually upload a PDF file to the preview cache
 #40806  by jllort
 
If you want always want to make this conversion, the best option is create an automation action, and each time document is created in openkm, convert to pdf and delete word document. If you have Java skill I can guide on you for doing it.
 #40808  by mkwong98
 
I'll follow the development guide first to install the development tools. It will be great if you can tell me how the source code files are organized. Thank you.
 #40813  by jllort
 
Here are some clues about it:
- You should create an action. Take a look for example the class named OMRDataCapture.java as scheleton for creating new action.
In the logic you should convert any document to pdf ( excepts pdf documents ), take a look at DocConverter.java there's a method named
Code: Select all
doc2pdf(File input, String mimeType, File output)
- You must download the file to server tmp ( take a look at FileUtils.createTempFile()) calling from the method getConted from OKMDocument.java API class:
Code: Select all
public InputStream getContent(String token, String docId, boolean checkout)
token should be null ( then is using user context )
docId can be document uuid or document path
checkout must be false

- From OKMDocument.java you can use other interesting methods like move or delete, etc...

Note: New actions must be registered into database, take a look at:
http://wiki.openkm.com/index.php/Enable_automation
http://wiki.openkm.com/index.php/Extend_automation_6.0
http://wiki.openkm.com/index.php/Automation

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.