use coffeescript class for the PDF factory
use coffeescript operators
minor coffeescript cleanup
convert PDF.js promise to Angular $q promise

removes the need for $apply
add an offset in the html to check different visibility cases
clean up angular promises to avoid race condition in page size/number requests