5 ms·
Pdf.js: Rendering PDF with HTML5 and JavaScript
- andrewguenther 15y agoLoving this project. The more you can accomplish in the browser using HTML and Javascript the better.
- onedognight 15y agoThis is currently on the front page as http://news.ycombinator.com/item?id=2657684 http://news.ycombinator.com/item?id=2657684 .
- becomevocal 15y agoAwesome! Definitely going to keep an eye on this.
- bambax 15y agoAccording to the example, it seems to render PDFs pages as canvas images; wouldn't it be more interesting to render them as HTML...?
- starwed 15y agoA more technical overview has the answers: http://blog.mozilla.com/cjones/2011/06/15/overview-of-pdf-js-guts/ http://blog.mozilla.com/cjones/2011/06/15/overview-of-pdf-js... But tl;dr: "we currently plan on doing a fast first-paint of pages using canvas, concurrently building an SVG document for the page in the background, and when the SVG document is ready, switching to that."
- maratd 15y agoThat's not possible. The PDF format supports geometric shapes, which isn't something supported in HTML. Try drawing a circle using just HTML.
- hucker 15y agoWell, in theory you could render text as HTML (with @font-face for example), and then have individual canvas elements for the geometric shapes and images.
- maratd 15y agoIn theory, you can also use CSS3 and some hackery and get all the geometric goodness ... but that's in theory. In practice, your code will look oh so nasty and be unmaintainable. Maybe by HTML6 or CSS4 we'll get some geometric goodness making this feasible, but for now, Canvas or SVG is the way to go.
- deleted 15y ago[deleted]
- neovive 15y agoIt will be very interesting to see how much Adobe supports and encourages these types of projects going forward. Will we ever see an official standards-based PDF reader delivered by Adobe?