At Crocodoc we tested out a similar approach using the Canvas element to render pages, but ultimately opted to go the @font-face route for a number of reasons, including:
- Near-instant client-side rendering (albeit a one-time ~5 second wait during server-side processing)
- Native font rendering (Canvas rasterizes all text and doesn't benefit from technologies like ClearType)
- Native text selection (which is important for overall UX and our annotation tools such as highlighting)
- Better performance on mobile devices (this is an ongoing project)
Here's a comparison of the test file micheljansen links to (thanks!) compared with the same PDF in Crocodoc:
Crocodoc looks great! Just out of curiosity: do you have a set of fonts ready to deliver to the client in order to make the font-face approach work? What do you do if the PDF if using some obscure font type? Are you using Poppler for server side processing?
- Near-instant client-side rendering (albeit a one-time ~5 second wait during server-side processing)
- Native font rendering (Canvas rasterizes all text and doesn't benefit from technologies like ClearType)
- Native text selection (which is important for overall UX and our annotation tools such as highlighting)
- Better performance on mobile devices (this is an ongoing project)
Here's a comparison of the test file micheljansen links to (thanks!) compared with the same PDF in Crocodoc:
- Canvas rendering: http://bit.ly/kU0mlW
- Crocodoc rendering: http://bit.ly/je2wcv
Edit: By the way, we're really impressed by this canvas implementation :-)