samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

Universal Viewer should display for PDFs #3149

Open sandbergja opened 6 years ago

sandbergja commented 6 years ago

Descriptive summary

A large part of our collection is our student newspaper, which is primarily scanned PDFs. It would be really nice to use the Universal Viewer to display these newspaper issues to users on the Work page.

Rationale

Allowing users to page through PDFs on the Work page provides convenience for users. This would provide a similar experience to platforms like issuu.

Current behavior

In default hyrax 2.0 and nurax, the work page displays just an image of the 1st page of a PDF, rather than a Universal Viewer.

no-reply commented 6 years ago

@vantuyls is this a 2.x issue, to your eyes?

boveus commented 6 years ago

We (Georgia State University) are also interested in this feature.

sandbergja commented 6 years ago

I also got a request that we have some way of linking to specific pages in large PDFs (e.g. 500-page openly licensed textbooks, where an instructor might want students to start reading at chapter 3). I believe that the Universal Viewer is capable of doing this, so I'd like to request that the hyrax implementation also allow users to create a link to a specific page within the Universal Viewer of a PDF.

bunderwood commented 5 years ago

We at SEBTS (Southeastern Baptist Seminary) second the notion. @sandbergja as a workaround, I have set hyrax to allow PDFs to be viewed inline in the browser instead of forcing download:

edit /gems/hyrax-2.4.0/app/controllers/hyrax/downloads_controller.rb:

def content_options        
  if file.mime_type == 'application/pdf'
    super.merge(disposition: 'inline')          
  else 
    super.merge(disposition: 'attachment')
  end
end
vantuyls commented 5 years ago

@no-reply lets see if we can put or find some resources for this one.

jeremyf commented 4 years ago

The following came up in Slack: https://samvera.slack.com/archives/C0F9JQJDQ/p1595873062202500

Hi friends. We're really interested in getting this issue resolved sometime soon: https://github.com/samvera/hyrax/issues/3149. It seems like several local institutions are finding different workarounds, but it would be really nice to have this in stock Hyrax. How big of a project would this be? What's the best way for us to advocate for this?

I responded:

I think what would be helpful is knowing what workarounds others are using. I see https://github.com/gwu-libraries/scholarspace-hyrax/commit/ea541ba401deac323af87e1365b16b64d9937808 (following the issues/commits/references), and am wondering if that answers the problem. If so, I think there’s a question of “can we get CLA signatures” (or do we have them). My guess is the core contributing effort right now does not have this as a priority at their institution.

jlhardes commented 3 years ago

Slack conversation brought this issue up recently. Hyrax should stay within IIIF spec for showing things in UV, so at this point that would mean converting PDF to separate page images to show in UV. Otherwise, if browsers can show PDF files inline, that seems reasonable to set Hyrax to be able to open PDFs that way (and maybe in a new browser tab) rather than download only.