Skip to main content

JODReports is alive

Yesterday we got a requirement from our consumer to convert MS office document to Html as like a google feature "View as html" on portal. As always it was very urgent and with high priority task on Jira. At first i have tried to solve it on regular way but found that there is no straight forword way on java to manage the task. A few commercial product has available on the web to solve the task. One of them are Davisor, 1 cpu license is about 2400 euro. Another one is Aspose. Download their trail version and first of all i discover that Aspose has not support convert Pdf to Html. Davisor convert MS office document not very well, nested table couldn't convert to html at all.
After a few googling i have found some information to use Open Office Org (ooo) to convert MS office documents to any format including PDF, html e.t.c. Also found a few fragment of code and API documents of OOO and JODConvertor open source to convert MS office documents. With great surprise i found that JOdConverter implements OOO api and it's out of box api to convert documents.
JODconverter library provides:
1) CLI to convert documents from command line
2) High level Java api
3) Web service to convert documents
4) Maven 2 plugin
JodReports even provides very well documented user guide to quick start. All you have to need is to start Open office application as and service and you are ready to go.
For starting OOO follow the command
ip-95-221-157-44:~ samim$ /Applications/OpenOffice.org.app/Contents/MacOS/soffice -accept="socket,host=localhost,port=8100;urp;" -nologo -headless

Now you are ready to make some experiment with MS office documents,
OpenOfficeConnection conn = new SocketOpenOfficeConnection(8100);
try {
conn.connect();
DocumentConverter converter = new OpenOfficeDocumentConverter(conn);
converter.convert(new File("/Users/samim/Downloads/big.doc"), new File("/Users/samim/Downloads/big.html"));
} catch (ConnectException e) {
e.printStackTrace();
} finally {
conn.disconnect();
}

You could also customize your export options whenever convert to PDF documents. JOdConverter save my a lot of time and solve my task and satisfy our customer. Many thank't to the developers of the library.

Comments

Popular posts from this blog

8 things every developer should know about the Apache Ignite caching

Any technology, no matter how advanced it is, will not be able to solve your problems if you implement it improperly. Caching, precisely when it comes to the use of a distributed caching, can only accelerate your application with the proper use and configurations of it. From this point of view, Apache Ignite is no different, and there are a few steps to consider before using it in the production environment. In this article, we describe various technics that can help you to plan and adequately use of Apache Ignite as cutting-edge caching technology. Do proper capacity planning before using Ignite cluster. Do paperwork for understanding the size of the cache, number of CPUs or how many JVMs will be required. Let’s assume that you are using Hibernate as an ORM in 10 application servers and wish to use Ignite as an L2 cache. Calculate the total memory usages and the number of Ignite nodes you have to need for maintaining your SLA. An incorrect number of the Ignite nodes can become a b...

Apache Ignite Baseline Topology by Examples

Ignite Baseline Topology or BLT represents a set of server nodes in the cluster that persists data on disk. Where, N1-2 and N5 server nodes are the member of the Ignite clusters with native persistence which enable data to persist on disk. N3-4 and N6 server nodes are the member of the Ignite cluster but not a part of the baseline topology. The nodes from the baseline topology are a regular server node, that store's data in memory and on the disk, and also participates in computing tasks. Ignite clusters can have different nodes that are not a part of the baseline topology such as: Server nodes that are not used Ignite native persistence to persist data on disk. Usually, they store data in memory or persists data to a 3rd party database or NoSQL. In the above equitation, node N3 or N4 might be one of them. Client nodes that are not stored shared data. To better understand the baseline topology concept, let’s start at the beginning and try to understand its goal and what ...

Benchmarking high performance java collection framework

I am an ultimate fan of java high performance framework or library. Java native collection framework always works with primitive wrapper class such as Integer, Float e.t.c. Boxing and unboxing of wrapper class to primitive data type always decrease the java execution performance. Most of us, always looking for such a library or framework to works with primitive data type in collections for increasing performance of Java application. Most of the time i uses javolution framework to get better performance, however, this holiday i have read about a few new java collections frameworks and decided to do some homework benchmarking to find out, how much they could better than Java native collection framework. I have examine two new java collection framework, one of them are fastutil and another one are HPPC. For benchmarking i have used java JMH with mode Throughput. For benchmarking i took similar collection for java ArrayList, HashSet and HasMap from two above described frameworks. Col...