News for hackers. Stuff that matters.
Re:Pdf.js: PDF Reader in JavaScript by jowiar on Friday September 14, 2012 @03:29AM (#4520556)
1) From a technical perspective, this is damn cool - exceedingly well done. Color me very impressed.

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).

Re:Pdf.js: PDF Reader in JavaScript by crisnoble on Friday September 14, 2012 @08:45AM (#4521328)
Personally I wish all sites used this instead of scribd/slideshare or opening up external programs.

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.

Re:Pdf.js: PDF Reader in JavaScript by geofft on Saturday September 15, 2012 @11:41PM (#4528162)
> This will just work on different browsers, different OS etc.

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.

Re:Pdf.js: PDF Reader in JavaScript by RandallBrown on Friday September 14, 2012 @03:59AM (#4520648)
I think Firefox has been shipping with this for awhile to view PDFs. It may be an about:config value you have to turn on though.
Re:Pdf.js: PDF Reader in JavaScript by qxcv on Friday September 14, 2012 @05:36AM (#4520901)
I only noticed it in FF15, but it may have been there for longer. Change pdfjs.disabled to false in about:config (followed by a browser restart) if you want to turn it on. Here's a test file[0] should you wish to test it out.

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.

Re:Pdf.js: PDF Reader in JavaScript by SilasX on Friday September 14, 2012 @02:16PM (#4523133)
Sweet! (It voids the non-existent FF warranty though...)

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 :-/

Re:Pdf.js: PDF Reader in JavaScript by JasonFruit on Friday September 14, 2012 @09:57AM (#4521631)
I've been using it for a few weeks now, and have noticed that it:

- 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.

Re:Pdf.js: PDF Reader in JavaScript by Argorak on Friday September 14, 2012 @05:37AM (#4520902)
It is included, but off in release versions at the moment.

In about:config :

name: pdfjs.disabled status: default type: boolean value: false

Re:Pdf.js: PDF Reader in JavaScript by pucinators on Friday September 14, 2012 @06:35AM (#4521010)
I'm no usability expert, but to me it would make more sense to name that parameter "pdfjs.enabled" true/false
Re:Pdf.js: PDF Reader in JavaScript by pilif on Friday September 14, 2012 @06:50AM (#4521049)
about:config isn't really optimized for usability and there's some advantage to the double negative in that the absence of a value could be treated as a false boolean value.

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)

Re:Pdf.js: PDF Reader in JavaScript by alter8 on Friday September 14, 2012 @09:40AM (#4521551)
Does that mean I can just remove the Firefox extension installed from https://addons.mozilla.org/en-US/firefox/addon/pdfjs/ and then turn on this setting will enable a built-in PDF viewer?
Re:Pdf.js: PDF Reader in JavaScript by mistercow on Friday September 14, 2012 @05:07PM (#4523968)
>Give me a link to a PDF, which Preview.app handles in wonderful fashion any day.

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.

Re:Pdf.js: PDF Reader in JavaScript by jowiar on Friday September 14, 2012 @05:26PM (#4524054)
For me it put anything in my download folder. It opens in the browser in a reasonable, non-resource-abusive fashion. I'm on Safari 6/Mountain Lion, so I'm not sure what version this happened.
Re:Pdf.js: PDF Reader in JavaScript by mistercow on Friday September 14, 2012 @06:07PM (#4524236)
OK, that's new in Mountain Lion apparently (Lion was the OS X that chased me away). I assumed it was the same as in previous versions since you mentioned Preview.app, but it appears that Preview.app isn't involved anymore when you open links in Safari; it just uses a built-in PDF viewer the same way Chrome does.
Re:Pdf.js: PDF Reader in JavaScript by Swizec on Friday September 14, 2012 @04:09AM (#4520683)
A few months after this was first shown on HN Chrome started shipping with a built-in pdf reader that looks exactly the same on both MacOS and Linux.

I always assumed it was pdf.js

Re:Pdf.js: PDF Reader in JavaScript by fafner on Friday September 14, 2012 @04:53AM (#4520800)
No, Chrome has its own binary plugin. IIRC it is closed source and not available in Chromium.

Pdf.js is developed by Mozilla and now shipped with Firefox and it works quite well so far.

Re:Pdf.js: PDF Reader in JavaScript by esolyt on Friday September 14, 2012 @05:26AM (#4520878)
That's correct. I use Chromium on Arch Linux and it doesn't come with the proprietary pdf reader by default.
Re:Pdf.js: PDF Reader in JavaScript by mcrittenden on Friday September 14, 2012 @11:35AM (#4522179)
You said "by default" which is correct but just for the sake of completeness, the built in Chrome PDF reader can easily be added to Chromium on Arch using this package from the AUR: https://aur.archlinux.org/packages.php?ID=44148

I've been using it for almost a year now without issue.

Re:Pdf.js: PDF Reader in JavaScript by esolyt on Sunday September 16, 2012 @04:49PM (#4530304)
Me too! In fact, that's why I said "by default" :)

Similarly, Pepper Flash Player can also be integrated from AUR.

Re:Pdf.js: PDF Reader in JavaScript by hey_lu on Friday September 14, 2012 @06:28AM (#4520996)
There is also a Google Chrome/Chromium extension also provided by the pdf.js team. (It's not in the webstore, though.)

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.)

Re:Pdf.js: PDF Reader in JavaScript by esolyt on Friday September 14, 2012 @06:45AM (#4521038)
I agree. Separate windows for PDFs is terrible.

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.

Re:Pdf.js: PDF Reader in JavaScript by knowtheory on Friday September 14, 2012 @05:41AM (#4520906)
I believe all the other replies to your comment to be incorrect.

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... )

Re:Pdf.js: PDF Reader in JavaScript by cygal on Friday September 14, 2012 @06:09AM (#4520958)
This is not a PDF reader but a graphics library.
Re:Pdf.js: PDF Reader in JavaScript by knowtheory on Friday September 14, 2012 @06:41AM (#4521029)
Re:Pdf.js: PDF Reader in JavaScript by alexlarsson on Friday September 14, 2012 @08:21AM (#4521257)
That code is for drawing to a pdf.
Re:Pdf.js: PDF Reader in JavaScript by wlesieutre on Friday September 14, 2012 @04:18AM (#4520709)
I believe Chrome's pdf plugin is based on Foxit
Re:Pdf.js: PDF Reader in JavaScript by fafner on Friday September 14, 2012 @07:51AM (#4521155)
I found Preview.app always annoying. E.g., the maximize windows button not maximizing the window. Sure it is better than Adobe Reader. But there are quite a few very nice alternative PDF viewers better than it. And pdf.js is great as a browser plugin because opening PDFs won't disturb your browsing any more.
Re:Pdf.js: PDF Reader in JavaScript by thomasfrank09 on Friday September 14, 2012 @08:44AM (#4521321)
I agree about Preview - but mainly I just hate having to download PDFs to read them. Most of the time I don't need them long-term.
Re:Pdf.js: PDF Reader in JavaScript by chrismonsanto on Saturday September 15, 2012 @06:02AM (#4525790)
I wouldn't say it's exceedingly well done... yet. It is so slow it is unusable on my OC'd core i5, and can't search pages you haven't looked at yet. The last one is a deal breaker for me. Really the only reason I use chrome for my day to day browser is for the PDF plugin. Once this project matures I'm out.
Re:Pdf.js: PDF Reader in JavaScript by pwenzel on Friday September 14, 2012 @03:39PM (#4523558)
How well does printing work when PDF.js handles the rendering?