« 戻る

Live Preview for Document Library

Company Blogs 2011/01/31 投稿者 Alexander Chow

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.

コメント 作成者 日時
Nice improvement! Thanks a lot, Alex! Jonas Yuan 2011/01/31 13:14
Awesome... was just thinking how useful a... Ryan Paul Schultz 2011/01/31 13:25
Cool. Looks a lot like the alfresco share... S L B 2011/01/31 13:57
Great job Alex. But why not implementing pdf2swf ? Christophe Cariou 2011/01/31 14:54
in my opinion, we should avoid using SWF flash... Jonas Yuan 2011/01/31 15:41
Yah, like Jonas's comment, we decided against... Alexander Chow 2011/02/01 1:13
Thats cool. Open Office is to be installed in... Sandeep Nair 2011/01/31 21:11
Very nice! What about the conversion speed for... Peter Mesotten 2011/02/01 0:37
@Sandeep OpenOffice and ImageMagick on the... Alexander Chow 2011/02/01 7:36
Great job Alex! :) Sergio González 2011/02/01 4:44
Cool feature! Juan Fernández 2011/02/01 5:22
Hi Alex, This improvement along with the other... Shagul Khajamohideen 2011/02/01 5:28
will this preview also be available when using... Kathleen Acton 2012/01/19 10:27
Yes, it is. Actually, you can already download... Alexander Chow 2012/01/19 16:35
This feature is automatically available on... Igor Kanshyn 2014/06/19 14:20

Nice improvement! Thanks a lot, Alex!
投稿日時:11/01/31 13:14
Awesome... was just thinking how useful a feature like this would be! thanks!
Jonas X. Yuanへのコメント。投稿日時:11/01/31 13:25
Cool. Looks a lot like the alfresco share preview.
投稿日時:11/01/31 13:57
Great job Alex. But why not implementing pdf2swf ?
投稿日時:11/01/31 14:54
in my opinion, we should avoid using SWF flash - SWF flash does not get supported in iPad, and iPhone.
Christophe Cariouへのコメント。投稿日時:11/01/31 15:41
Thats cool. Open Office is to be installed in server right? And what about ImageMagick, should it be on server or on client machine?
投稿日時:11/01/31 21:11
Very nice!

What about the conversion speed for this? How long did it take to convert the 27 pages long document?
投稿日時:11/02/01 0:37
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.
Jonas X. Yuanへのコメント。投稿日時:11/02/01 1:13
@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.
Peter Mesottenへのコメント。投稿日時:11/02/01 7:36
Alexander Chowへのコメント。投稿日時:11/02/01 4:44
Hi Alex,

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

Great Job!!!
投稿日時:11/02/01 5:28
will this preview also be available when using the document library display as well?
投稿日時:12/01/19 10:27
Yes, it is. Actually, you can already download the 6.1 release from the downloads page and check it out yourself!
Kathleen Actonへのコメント。投稿日時:12/01/19 16:35
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?
投稿日時:14/06/19 14:20