Trapeze uses many new features available in HTML5 including: canvas, web workers, drag/drop files, and some of the new file API’s. The new canvas element is the biggest piece that enables all the 2D drawing commands that a PDF needs to render correctly. Web workers are used to parse the PDF files in a another thread so the browser doesn’t lock up. Web workers also draw the PDF to what I call a FauxCanvas which basically just stores all the operations to the a fake canvas object and then sends them back to the main thread to apply them to the real canvas when its ready. Hopefully, in the future this will not be needed if an off screen canvas is made available to web workers. The drag and drop file opening was added just to see how it works.
Some of the limitations:
- No ability to open a PDF from a URL. This is because cross site AJAX requests are not allowed by the browser. To get around this a proxy can be used, but I don’t currently have the funds to pay for the bandwidth a proxy pdf server would require.
- Only tested in Firefox and Chrome.
- Missing support for portions of the PDF spec (full color space support, pdf functions, patterns, certain image types, …).
The project source is available at https://github.com/brendandahl/trapeze-reader/
this trapeze stuff is way cool!!! thanks a lot for sharing!
html5, css3, jquery, php and now trapeze etc.: to me, the web is a giant box of legos with new, exciting pieces coming in all time & they’re even for free!
Where can i download the files? the lists files on google code are empty (http://code.google.com/p/trapeze-reader/downloads/list)
Thanks in advance!
There currently isn’t an official release. To get the code you’ll need to check it out from the mecurial repository. See http://code.google.com/p/trapeze-reader/source/checkout
It is really a great project.
btw, do you know https://github.com/andreasgal/pdf.js it is a another similar project.
and if you need php hosting, please contact with me, I can offer you.
Funny you should mention that project. Next week I’ll actually be starting full time on mozilla’s pdf.js reader.