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.


But wondering if the Drupal way can offer any better.

8 Answers 8


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.

  • 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. Mar 14, 2012 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, 2012 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. Mar 14, 2012 at 18:31

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


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:


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


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.

The PDF to ImageField module that converts PDFs to images (although I haven't used it). Here is an excerpt about it from the module's project page:

... provides automatic conversion of uploaded PDF files to images. It can be used either to create a snapshot of the front page to use as a preview thumbnail, or to generate a gallery of images from each page in the document.

The module is implemented as an additional widget for File Field where PDFs are uploaded to. It places generated images into a Image Field on the same content type.

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.


If the browsers of your users support HTML5, you can use the PDF module. Here is an excerpt about it from the module's project page:

Use HTML5 to display PDF files if users don't have pdf plugin for their browsers. Thanks to pdf.js project by Mozilla.

With this module you can use pdf.js to display PDF file all the time or only use pdf.js when visitors don't have pdf reader plugin.

If you need to support old browsers like IE6, you can try the File viewer module. Here is an excerpt about it from the module's project page:

... adds Internet Archive BookReader for PDF and EPUB support into Drupal to make both of them can be open and view file field in the browser. "Search inside" was just added. Can be bugy. If you upload a book, it will be very slow, because I just use JS for search. Maybe do it on server side in the future. didn't test on IE.

Neither of them require Flash.


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.


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.


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


Does anyone have experience with the contrib PDF module? Its project page mentions it uses the pdf.js project by Mozilla. I'll give it a test drive for d8 and report back....

Related: https://stackoverflow.com/questions/291813/recommended-way-to-embed-pdf-in-html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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