Display online pdfs attachment in drupal with pdf.js

pdf.js (https://github.com/mozilla/pdf.js) is a mozilla project for rendering pdf files with javascript.

Now it came with a standard Firefox download, but not everyone is using Firefox, thus it came the drupal module: https://drupal.org/project/pdf

Simple steps:

  1. activate pdf drupal module and libraries (on which pdf depends)
  2. read http://drupalcode.org/project/pdf.git/blob_plain/refs/heads/7.x-1.x:/README.txt but it could be misleading
  3. download the package from https://github.com/mozilla/pdf.js, the package, or git clone https://github.com/mozilla/pdf.js
  4. you really need node (but apt-get install node is enough): launch ‘node make generic‘, that is, you HAVE to do it, to make build folder
  5. upload the package, the whole package, on site/all/libraries/, the library directory being pdf.js (thus having: sites/all/libraries/pdf.js/build and sites/all/libraries/pdf.js/build and … so. And not, say, pdf.js-buid/…)
  6. configure a field of type file, the display as pdf

done.

Not convinced? me neither, this is what result, but of course display could be changed and fixed:

http://www.fincos.net/gse/gse-e-trasparenza-amministrativa