I think if you displayed the file in a viewer, then someone could still save and download a version. If you are trying to make a file viewable without giving them a copy, I don't think this technique would work.
Since there are multiple viewers for different file types, you would probably have to hand code something to check and identify the correct viewer to use, then you could use the examples on the site you linked to to show the correct viewer for that file type.