In part 1 of this series, I embarked on a quest for a Drupalmodule that would display a PDF on a web page. After reviewing the modules that didn't work in part 2, I thought I had a solution in part 3 with the PDF Reader module. But the actual solution turned out to be a third-party service after all.
For Special Effects, Look Elsewhere
If I were building the site for myself, I probably would have gone with the PDF Reader module.
I consider this the current solution for displaying PDFs on a Drupal 7 site.
However, this is a real-world example, and as I mentioned in part 1, my client had given me an example of how the PDF should appear. This example doesn't merely display the PDF, it also includes fancy "flipbook" effects. Specifically:
- You default to seeing two pages at once in a "spread". This feels more like a real paper magazine.
- You get a "page turn" effect when you move to a new page.
Neither Adobe Reader nor
pdf.js
currently include both these effects.So, in the end, the Drupal solution didn't work for this particular project. When I showed a demo of PDF Reader, my client decided that the display was not interesting enough, and it would be worth using a third-party service to get these additional effects.
Turn.js + pdf_to_images
= Fail
Before I left the Drupal ecosystem, I did try one other Drupal-centric approach: the turnjs module, which supposedly integrates with the
turn.js
library to create a page-turning flipbook.However, I ran into these problems:
- The turnjs module is still barely official; I had to use
git
to get the code. - Since
turn.js
uses images, not PDFs, I needed to use the separate PDF to ImageField module to convert the PDF to images. This module seems to have been designed more for making thumbnails than readable PDFs, so I had to increase the resolution and make very big files in order to make them readable. - The
turn.js
library would require a commercial license. I could only test the code using the previous major version. - Worst of all, when I ran a test ... it simply did not work. The images would show, but the "flip" effect was sadly broken. I couldn't get it to work in any browser.
Perhaps this solution would have worked with the commercial version of
turn.js
, but given how broken this earlier release was, it seemed unlikely.A Third Party Solution: Issuu.com
So the story of this search for a Drupal module ends in a third-party service. The specific result that this client desired simply was not available using only Drupal. We would have to use a third party. Sometimes, in the real world, that's how it goes.
There are several third-party options for displaying PDFs, but for now, our choice is Issuu.com. Issuu seems to have positioned themselves as the "YouTube" of online newsletters and magazines, and their slick viewer includes a two-page spread, the page turn effect, and more.
As with YouTube, you can embed your content on your own site using their viewer, while also hopefully getting additional views through appearing on their site. A free account shows "Related Publications" next to yours, but for a monthly fee, you can hide them and show only your PDF.
Using a third party doesn't mean that the Drupal site won't be involved. At worst, I can paste the Issuu embed code into Drupal nodes. However, there are also at least two modules for integrating Drupal with Issuu: Issuu Integration and Issuu Filter. Both modules have extremely low download numbers, but as the project proceeds, I'll be taking a look.
I'm guessing that I will set up a special content type which includes a "cover image", and when the user clicks on this cover image, it will open the Issuu reader in fullscreen mode. Stay tuned for a full report on combining Issuu.com and Drupal for classy online publications of PDFs.
SHARE