The Commons documents feature needs a viewer. It does not make much sense to have a separate tab and feature for documents with attachments if every other content type can also have attachments. To make it a real feature worth having, it needs to more than just a blog post (which is all it seems to be).

Most of the viewers I have seen for Drupal are third part integrations. Scribd is the most popular third party tool for viewing attachments, but the Drupal module for scribd does not appear well maintained and does not have a very large install base. I have not been able to get it to work. Crocdoc www.crocdoc.com is a new entrant into the field and I like what I have seen in other (non-drupal) applications that have incorporated it, but it does not yet have a Drupal module.

Use cases
As a site builder, I want my users to be able to view documents (pdf, MS Office and others) without having to download them so that people will not have to leave the site to explore the content of the attached documents.

As a site user, I want the upload function to create a thumbnail image of the first page of the document to increase the likelihood that people will find it and recognize it as something they want to explore.

As a site designer, I want to give users that post documents the option of either displaying the full document in an iframe window or as a thumbnail at the foot of a post with a Preview button next to it, so that they can decide how users will want to interact with their content.

As a site designer, I want to control whether or not the viewer allows markup, so that some applications can be collaborative and others can be merely informative.

As a site designer, I want the thumbnail to display in views listing node types with documents, so that it will provide a visual cue to explore the linked content.

As a site designer, I want the search function on my commons website to include the content of attached documents in search rankings so that relevant content in attached documents can be found as easily as content posted in nodes.

CommentFileSizeAuthor
#7 docs.png312.31 KBdavid.moore.ipg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pedrorocha’s picture

I agree that this would be a great feature, and maybe integrate with https://docs.google.com/viewer would be a good option too. There is a module in sandbox doing this integration: http://drupal.org/project/1073012/git-instructions

david.moore.ipg’s picture

it seems like the google viewer would be fairly straight forward to integrate into the nodes for documents, but I don't think it would support thumbnails for views.

david.moore.ipg’s picture

It seems like the Google viewer would be fairly straight forward to integrate into the nodes for documents, but I don't think it would support thumbnails for views.

david.moore.ipg’s picture

I guess one thorny issue with using any third party product like Scribd, crocodoc or google is the concept of private groups and therefor private documents.

That said, the document "feature" is very weak as is. You can attach documents to Blogs and there is little (if any) difference between the document feature and the blog feature.

pedrorocha’s picture

Maybe an embeded document viewer could be the best aproach, without the dependency of a third party service. Googling now, i found http://eric-blue.com/2010/01/03/how-to-create-your-own-personal-document..., that looks interesting as an option to came along with Commons Core, enabled by settings, maybe.

lightsurge’s picture

Don't see how this is really practical unless we install something like media mover module, and have some application server-side that can convert documents to flash and then view with something like flexpaper.

david.moore.ipg’s picture

FileSize
312.31 KB

I think the security considerations (private groups) make it more difficult that just integrating a third party hosted solution, but I still think it is essential to make the DC document feature relevant. I am attaching an image from my son's school system. I still think the thumbnail and inline viewer made a real difference in the user experience. But I suppose it would have to be built with everything hosted on the drupal site. No small undertaking for sure.

david.moore.ipg’s picture

Maybe the first step could be to generate the thumbnail. That would be a good start and a major improvement to the documents feature. That would not have the same privacy issues as the viewer piece. It looks like there is already a module that uses Image API and ImageMagick to do this for PDFs. I assume it should be possible for other document types as well.

http://drupal.org/project/pdf_to_imagefield

david.moore.ipg’s picture

Create PDF thumbnails with imagecache and ImageMagick while GD is still the default toolkit
http://drupal.org/node/641372

is helpful.

I guess part of this discussion should be how much is worth trying to do now in drupal 6.

It seems that drupal 7 has a lot more image support built into core

the main strategy I found out there for dealing with other file types (.doc, .ppt) was to "print" them to a pdf and then create the thumbnail from that.

If this is to be something that makes itS way into the document feature of commons core are there other considerations that need to be taken into account? Like requiring ImageMagick instead of using GD?

david.moore.ipg’s picture

For my purposes, the google viewer would work quite nicely. I will have some closed groups, but no private groups and I actually want the attachments to be indexed by google, so that people searching for it are more likely to find our site content.

So, rather that trying to build this into the document feature, it appears a hack is in order. Since all it takes to use the google viewer is "http://docs.google.com/viewer?url=[document url]" I suppose I could could put that into custom module and alter it into the node--if I know how to write a modules.

I can manually create a preview link in the node pretty easily, so surely this is possible.

david.moore.ipg’s picture

Updating my own issue again and again--is that bad form?

Someone somewhere suggested the File Framework Module as a partial solution for document conversion. That module appears unmaintained and has some scary looking unresolved issues where people's whole server got hosed.

A simpler module to create thumbs of the first page of a document could be possible through an OpenOffice command line utility like unoconv, but that requires using utilities outside of drupal which might limit use on some platforms and on shared servers.

Don't know if that is worth pursuing.

david.moore.ipg’s picture

Component: Code » User interface

changing to UI

lightsurge’s picture

Wow yeah haven't seen that module before. Consider Media Mover module.

I think it would be difficult for Commons right now to insist on something like unoconv as part of requirements... but personally I do use it. We're seeing all kinds of magic with HTML5 so this sort of idea doesn't seem far off...

Although, apparently Sharepoint CMIS integration is a key feature #1299070: SharePoint CMIS module - code review so you never know, might be here soon.

david.moore.ipg’s picture

Media mover only addresses a few file types. It could be a piece of the solution.

The Crocodoc service is HTML5 and could make as much sense as google if I go with a third party integration approach. Google viewer supports more document types and google is going to have your content anyway, so less worries there about relying on a third party.

david.moore.ipg’s picture

I was able to create a simple filefield formatter that opens attached documents in the google viewer. Now I just have to change the display type in the content type and it works. Not much of a hack and easy to maintain as commons evolves. The only issue is that I really wanted it to open in an axaj/jquery modal popup window, but the Popups API that I used won't allow an external URL as a link target in a pop window.

Is there something within the Commons implementation of JQuery UI that might allow for a link target to an external site to be displayed in a popup window?

cpliakas’s picture

Some references to discussions, existing solutions, and third party solutions for additional context.

There are a lot of conversations inside of Drupal with no real solutions:

Some Drupal solutions exist but are abandoned or in sandbox state:

One cool technique integrates with Google's document viewer (D7 only, but small codebase):

Other non-Drupal document conversion techniques exist that could be integrated with:

There's a lot of opportunity here for contributions that could lead this effort in Commons and Drupal in general.

Thanks,
Chris

lightsurge’s picture

There's some pretty exciting developments going on with the HTML5 document viewer by flexpaper... you can see a sample here:

http://flexpaper.devaldi.com/examples/html5viewer/default.jsp

From what I can tell, they're creating images for each PDF page, as well as converting the interactive elements (i.e. text, links etc) on the pages into a JSON format which specifies exactly where these elements should fall on the page.

The outcome from flexpaper combining these two things is something that looks/feels almost exactly like a PDF document and is faithful to its original appearance (unlike say converting to HTML), but is of course cross-browser compatible. It's so similar to the HTML5 viewers from the likes of Google and Scribd that I think they're probably using the same method.

They've created a helper program PDF2JSON http://code.google.com/p/pdf2json/ to help with this (and it's very fast). And of course, using a tool like ImageMagick, it can be very fast to create images for each page as well.

Great stuff, I do wonder if this is the point at which they're moving on to being a commercial product (I can't find a link to download the HTML5 viewer)... Couldn't blame them for that, it must be costing a fortune to make something that looks so polished, but for me to be able to use it, I do hope not.

lsolesen’s picture

Version: » 6.x-2.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.