cancel
Showing results for 
Search instead for 
Did you mean: 

Custom dashlet with PDF preview

markthomson
Champ in-the-making
Champ in-the-making
Hi,

I'm working on custom dashlet and would like to use PDF preview functionality from Document Library. I would like to add preview form which would show user selected document. User would be able to select document from the list of documents above preview form.

I have few questions regarding this dashlet:
  • Is it possible to add preview to dashlet

  • Could you give me some hints on how to embed preview in dashlet
Thank you for your help.
2 REPLIES 2

billerby
Champ on-the-rise
Champ on-the-rise
That will be possible if you use a pretty wide dashlet  Smiley Very Happy

If you want to use the same previewer as the one used in the document library you will have to look into the source to find out which component is used. We have another simpler solution if you just need to be able to view a pdf.

Create a backend repository webscript that streams the pdf content back to the caller. (You can probably use this existing webscript "org/alfresco/cmis/content.get")In your dashlet when a user clicks on a document link you fire an event that calls your backend webscript and populates the iframe with the content. Almost all browsers will know how to display the pdf in your iframe as long as you set the content type to "application/pdf" on the response of your backend script.

Good luck!
/Erik

wabson
Star Contributor
Star Contributor
Hi Mark,

The Media Previews add-on on Share Extras provides a site dashlet that can display an item from the Document Library. The version 0.x download implements video previews only and works on Alfresco 3, but if you check out the source code and build the JAR from this then that development version (Alfresco 4 only at the moment) will support ALL the previewers that normally appear on the document details page.

http://code.google.com/p/share-extras/wiki/MediaPreviews#Building_from_Source

We're planning on a new release of the project for Alfresco 4 once we have merged in some extra features such as direct viewing of PDF documents in the web browser (for modern browsers) without using Flash. But if you have any feedback then I'd love to see if we can incorporate this in also.

Cheers,
Will
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.