5

I have been improving a document management project and one requirement is to render documents(word, pdf, etc) in web page. Pdf can be rendered with iframe, object or embed tag and servlet. But the other documents like word, excel can not be rendered in the web page. My solution is to convert these documents to pdf or html on rendering and render them like this. I've tried to convert them with JODCONVERTER and it does convert but converting a word(docx) almost with 700 pages to pdf 25-30 sec, to html 30-35 sec. It is too much.In the course of events, waiting for too much is not good for users. Documents will be stored our server, not another place. Is there another thing for faster conversion or better solution?

Thank!

Ahmet DAL
  • 4,445
  • 9
  • 47
  • 71
  • 1
    You can pre-convert to pdf/html and save into database/file system. Or is there any reason you don't do this? – Pau Kiat Wee Apr 17 '12 at 14:51
  • There will be disk space problem then. I think It is not good to store both version just to render them in webpage. – Ahmet DAL Apr 17 '12 at 17:05
  • Alfresco Community can preview files perfectly. You may want to check their code http://wiki.alfresco.com/wiki/Source_Code – Soronthar Jun 19 '12 at 00:58
  • Alfresco previewing system also stores the swf versions of documents in a hidden property. – bekce Jul 31 '12 at 13:03

2 Answers2

1

You could use jodconverter + LibreOffice 3.5.* or jodconverter + OpenOffice.org 3.4.1 (I have tried both recently and they are way faster than LibreOffice 3.6+/4.0+) in combination with a lazy/parallel conversion process to improve response times.

Gabriel
  • 117
  • 1
  • 14
  • Can you share how much faster? – Ahmet DAL Jun 06 '13 at 08:54
  • Of course my numbers are experimental, but in my trials LibreOffice 3.6+ (LO36) takes twice the time to convert a 4.3 mb (500 pages aprox.) "doc" to pdf vs. the time LibreOffice 3.5 (LO35) took for the same task. To be explicit: LO35: 35s., LO36: 72s., OpenOffice.org 3.4.1: 42s.; aprox. times in seconds. (sorry for the "english") – Gabriel Jun 07 '13 at 12:54
0

You cannot transform 700 pages of content in a snap. Even Google Docs puts you on a cloud transformation queue for your uploaded documents. So you can implement this kind of queue which will lazily transform your documents one by one, and you can show a proper message to the user while transform operation is pending. This queue must save the transformed file to filesystem of course, so you can display it anytime you wanted. You must consider the disk space problem here.

A blind solution is to just open the file in another browser tab with correct mimetype, given that the browser is ie and microsoft office is installed, hopefully it will open the file natively in the browser. However it is not a platform-independent solution.

bekce
  • 3,782
  • 29
  • 30