Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm looking to display a PDF on a page, but don't want to outsource the hosting to scribd or slideshare, or one of the other players. My constraints are basically...

  1. I want to host it on my site.
  2. I want it to look like a slideshow (can click to go forward, navigation backward, etc.)
  3. I want most users to have whatever they need to access it already (ie, if it's SWF, fine.)
  4. I want the whole PDF to be downloadable easily, as a PDF (rather than SWF, etc).

Does anything fit that bill? I saw on stack overflow, at one time the answer was no.

http://stackoverflow.com/questions/291813/best-way-to-embed-pdf-in-html

But wondering if the Drupal way can offer any better.

share|improve this question

7 Answers 7

up vote 7 down vote accepted

Drupal is essentially a framework, it can't do anything that a 'normal' website can't do. This includes displaying PDF files in the format you want.

The only way is to use Flash (as suggested on the SO post you linked to). This would involve either building the SWF file yourself using Adobe's tools, or using one of the dozens of tools available to build a navigable SWF from a PDF file (e.g. SWFTools).

Drupal only comes into the equation when you actually want to display the Flash file.

Some purists might actually argue that this is a bad idea anyway; you should probably allow your users to read PDF files using the software that they have chosen for that particular job.

If you were trying to DRM your PDF for whatever reason then it might make sense, but as you're providing a download link to the direct file anyway I don't think this applies.

share|improve this answer
    
I take your point, Clive, but even the SO post I linked to said there are a lot of ways to handle PDFs in HTML, not just using flash, such as (a) google docs, (b) PDFObject, or just (c) <embed src=". I understand some purists would rather be able to choose their own reader, but I was charged with accomplishing a given objective for a general audience less concerned with that. –  Mittenchops Mar 14 '12 at 17:13
1  
@Mittenchops Sorry I should have been more clear, all I meant to say was that the options offered in that SO post remain exactly the same regardless of whether Drupal is involved or not –  Clive Mar 14 '12 at 17:15
    
I dig, thanks! That is helpful. I guess I was fishing additionally for whether someone had made a sexy module to make a decision for me that did this in a "standard" kind of way. –  Mittenchops Mar 14 '12 at 18:31

You could do this using imagecache with ImageMagick + GhostScript to convert the PDF pages into individual JPG files. Then you can use a slideshow module to display the JPGs, and provide a download link to the original PDF.

Here's a module that converts PDFs to images (although I haven't used it): http://drupal.org/project/pdf_to_imagefield

Keep in mind many servers use GD for image processing, and GD cannot deal with PDFs. So you need to make sure you have ImageMagick available on the server.

share|improve this answer

I don't think you can get around using Flash in this situation, especially if you want a user interface that is anywhere near what the user would get by opening the PDF natively. It's dubious to hijack the user's preference for viewing PDFs in the first place, but at least don't give them a highly inferior UI/experience to boot.

The SWFTools module has support for FlexPaper, an open-source flash plugin for viewing PDFs. It's only available for D6, but another option would be to create a custom module to implement the FlexPaper API yourself.

share|improve this answer

Have you considered converting your PDF into HTML and import to your Drupal site? You could do that using Acrobat's save as Word function, clean up the document in Word and save as HTML. There are ways to then import the single HTML into Drupal books such as using Feeds (see some examples). That way your pages will be just standard HTML and it will be way easier to navigate through pages than using an embedded PDF reader.

share|improve this answer

Noticed some good answers already but havent seen this module been mentioned:

http://drupal.org/project/pdf_reader

You might want to take a look at it. It offers for example the option to use pdf.js, the pdf viewer Mozilla is going to use in FF 19:

http://www.webpronews.com/mozilla-kills-the-pdf-plugin-in-firefox-19-2013-01

I would not recommend to use any Flash now, HTML5 is out and tablets being hot (compatible problems).

share|improve this answer

If your users' browers support HTML5, you can use https://drupal.org/project/pdf. If you need to support old browsers like IE6, you can try https://drupal.org/project/fileviewer.

Neither of them require Flash.

share|improve this answer

Try FlexPaper - there is a HTML5 PDF viewer with "readonly" option - should do the trick and you get around Flash: http://flexpaper.devaldi.com/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.