0

I am making a application which gets its data from Alfresco and i want to show a document (which is in Alfresco) on my page with controls like going to the previous and next page. I found the jQuery Media library, but it only opens PDF files. So my question is, what is the best way of showing .doc, .docx, .ppt, .pptx, etc. files without going to Alfresco itself? I've tried Prism Viewer and the Google Docs viewer but they both cant open files from Alfresco for some reason.

Thanks!

dylanvdb
  • 106
  • 18
  • 1
    I think Alfresco is not pertinent to your question. I think a better way to ask it is, "What is the best way to show office documents in a browser?". Alfresco is just the place where the file lives--it isn't involved with displaying the doc in your external application. – Jeff Potts May 19 '14 at 14:47
  • Yes i know, but it would be a bonus if someone also had a snippet of code for me to check out. – dylanvdb May 23 '14 at 17:30

1 Answers1

2

You should take a look at pdf.js - pdf.js is a browser-side PDF viewer. If you're using the current HEAD of Alfresco community, then Alfresco transforms your content automatically to PDF and stores the PDF as rendition (as new new Alfresco Share Viewer uses pdf.js internally).

There is a community addon for Alfresco Share 4.2 that uses pdf.js as document viewer & also contains the pdf rendition configs. That should be a good starting point: https://github.com/share-extras/media-viewers

Or checkout the current HEAD: https://github.com/Alfresco/community-edition Here is the current thumbnail-service-context.xml where the pdf rendition is defined: https://github.com/Alfresco/community-edition/blob/master/projects/repository/config/alfresco/thumbnail-service-context.xml#L219

alfrescian
  • 4,079
  • 1
  • 18
  • 20