Pdf.js: PDF Reader in JavaScript
mozilla.github.com
mozilla.github.com
We use LaTeX to generate the PDF. You could try pandoc if you're going from HTML (or markdown) to PDF.
Have we reached the point where Adobe Reader is so resource-guzzling that people prefer a JavaScript (gasp!) PDF interpreter to Reader? Wow.
Mozilla is also working on something similar for Flash: https://github.com/mozilla/shumway . I'm a bit sceptical but with the success of PDF.js I can't wait to use it.
1) In Firefox 15, the demo page adds two new options to my right click menu: Rotate clockwise and Rotate Counter-clockwise. Is Firefox recognizing pdf.js (since it appears that they are related) or pdf.js adding menu options? I didn't know JS could do that.
2) Isn't Javascript an embeddable language inside PDFs? I'm pretty sure I read that javascript is used, not necessarily for animations but for run-time dynamic layouts. If that's true, is pdf.js "eval"-ing that javascript?
I've seen custom contextmenus generated on pages[0] that override the built-in context menu but for some reason I've yet to come across a page[1] that adds to the existing context menu until today.
[0] replacing example: http://developer.yahoo.com/yui/examples/menu/tablecontextmen...
[1] appending example: https://bug617528.bugzilla.mozilla.org/attachment.cgi?id=554...
the reason is likely because browser compatibility for the context menu js api is pretty minimal [1]. firefox can use it on pages that are only going to be displayed in firefox, but for the internet at large it's pretty useless.
While I can't imagine myself using it anytime soon, it's clear that web applications are improving at a far faster rate then native applications and, with t large enough, the first derivative means that web will eclipse native.
This seems like an academic exercise at the moment; it's to prove that you can replicate a native experience only.
However, it seems that this could be vastly improved by playing to the strengths of the internet. The only online apps that have beat native ones so far have been because of cloud storage and collaboration. First, use filepicker.io or something so this can open my online files. Second, bake some collaboration into it.
So alas, I'm still searching for an easy way to convert HTML to PDF server or client side. I haven't looked at the code yet but I do wonder if one could get that functionality out of this if they wrestled with it enough. (I know there are other ways to turn HTML to PDF but a client or server side script to do so really is the best solution for my situation).
This ... is mind blowing.
currentPage is undefined http://mozilla.github.com/pdf.js/web/viewer.js Line 285
2) I hope I never actually see anyone using this on a website, attempting to make things "easier." Between Scribd and Slideshare, and Adobe trying to force its hideous crash-prone plugins into my browser, there are already enough people making a mess out of what is one of the more well-thought-out aspects of OS X. Give me a link to a PDF, which Preview.app handles in wonderful fashion any day.
3) It would make a sweet browser plugin on browser-in-a-box platforms and other platforms that don't have a nice native implementation (which upon further reading seems to be the goal).
I've been using pdf.js for a while on my Windows box (where it is enabled by default on the FF beta channel) and it has performed remarkably well. Sometimes it's a bit slower than Adobe Reader or messes up colour or formatting, but on the whole I've quite enjoyed using it.
[0]: https://svn.torproject.org/svn/projects/design-paper/tor-des...
Note that the text in [0] doesn't scale properly, and the page previews in the navigation pane just show garbled text. Usable, but only just.
What's better is, it allows the (awesome) extension Pentadactyl to click the buttons in the viewer (since it's part of the browser). Have to click on (or tab to?) to the document itself though, in order to be able to use keyboard navigation on it though :-/
In about:config :
name: pdfjs.disabled status: default type: boolean value: false
So if at one point pdfjs should be enabled by default, they can just get rid of the preference in the default preferences file altogether instead of having to ship one where it says enabled: true (because absence of the value would be treated as false)
- renders very well
- is extremely slow on large documents with images, but pretty good with text-only ones
- offers a more integrated experience than Adobe's plugin
I think it's very promising, and I look forward to seeing it become more polished.
I always assumed it was pdf.js
Pdf.js is developed by Mozilla and now shipped with Firefox and it works quite well so far.
I've used it since about half a year and I like it a lot. (Not having to download PDFs all the time and having PDFs in tabs alongside the sites I read.)
You can also separately download the proprietary PDF reader of Chrome and use it with Chromium. If you are using Arch Linux, it is available in the repositories.
I've been using it for almost a year now without issue.
Similarly, Pepper Flash Player can also be integrated from AUR.
Both Chrome and Android use the skia (http://code.google.com/p/skia/ ) library as far as i am aware (see http://code.google.com/searchframe#OAMlx_jo-ck/src/third_par... )
This will just work on different browsers, different OS etc.
Plus you can send links like this: http://mozilla.github.com/pdf.js/web/viewer.html#page=6&... To send a user to s specific part of the page. Right now usually you just send the pdf link and have to say, "check out the image on page 6".
Keeping the pdf in the browser and accessible to and from javascript opens up a world of possibilities.
For values of "different" that mean "as long as they all have fast processors and accelerated JavaScript". I tried this in a non-Apple browser on my iPad, which means no JITted Javascript interpreter, and it basically hung. I haven't even attempted it on my smartphone, which does have a native PDF-reading application.
Really? I can't stand that. My download folder ends up cluttered with (inevitably weirdly named) PDF files. Worse, I suddenly am switching between programs and tabs, rather than just tabs, and the two programs have very different search interfaces (and Preview.app's is downright clumsy). Since I rarely look at a PDF if I'm not researching something, navigation and searching are really important considerations.
I'm quite happy with the Chrome PDF viewer though.