Live Preview for Document Library

Liferay's engineering team has been doing a lot of work on the Document Library for version 6.1.  But in one of the recent weekly meetings, a discussion sparked off about the possibility of having some kind of live preview for the Document Library.  This is meant in terms of both (1) thumbnails of files in the file listing and (2) previews of the actual document that you can go through without downloading the file.   So, after a little toying around, I got a first cut of this working in trunk (see LPS-13145).  Both of them still need to be reskinned (our UI guys are great at that), but I thought I would show a few screenshots of what things roughly look like.

For thumbnails (note that the future version will allow you to pick a plaino list view vs. a thumbnail'd view):

Then, you can also go through each page of the document as well (eventually with zooming capabilities):

 

How does it work in the backend?  Well, first, it converts files to PDF format using OpenOffice.  So you need to make sure you have that installed.  Then, it breaks up the PDF into images -- one for each page.  Now, OOTB, it does it using PDF-box.  But, ideally, you should install ImageMagick.  This is because PDF-box is great for fairly simple PDF documents, but can get a bit gibberish if you use fonts it doesn't know about and things like that.  ImageMagick also runs significantly faster.  So, all in all, it is much better if you install ImageMagick.

Blogs
Great job Alex. But why not implementing pdf2swf ?
in my opinion, we should avoid using SWF flash - SWF flash does not get supported in iPad, and iPhone.
Yah, like Jonas's comment, we decided against that since we didn't think it needed to be done with flash. It's also another thing the admins have to install on their systems and you don't really buy yourself anything either.
Thats cool. Open Office is to be installed in server right? And what about ImageMagick, should it be on server or on client machine?
Very nice!

What about the conversion speed for this? How long did it take to convert the 27 pages long document?
@Sandeep OpenOffice and ImageMagick on the server. Nothing special needed for the client.

@Peter It of course depends on the complexity of the document, but all processing is offloaded to an asynchronous call (so it doesn't slow your upload and continuing on your way). But once the asynch call starts running, it processed a 27 page test document in a minute with ImageMagick and a bit longer using PDFBox. Mind you, these are unscientific tests done on my untuned development environment.
Hi Alex,

This improvement along with the other DL changes will definitely make Liferay a much powerful platform.

Great Job!!!
will this preview also be available when using the document library display as well?
Yes, it is. Actually, you can already download the 6.1 release from the downloads page and check it out yourself!
This feature is automatically available on Liferay 6.2 now. Is there is a way to turn it OFF and have .pdf work like all the other documents?