For pdf there is an open source project started by mozilla and it's very good: https://github.com/mozilla/pdf.js/
You can see a hello world example : https://github.com/mozilla/pdf.js/tree/master/examples/helloworld
For the rest of document types I think LibreOffice said that are planning to build something in html5, but so far there isn't anything done.