IIUC, you are going down the Digital Rights Management path. A non-trivial task in itself. Adobe's PDF format supports various means of securing a file and they have LiveCycle Rights Management specifically for this. Adobe Digital Editions is something you will want to check out:
What DRM formats are supported?
Most libraries and bookstores that sell or loan PDF eBooks use Adobe’s
Content Server to protect their books.
This is the DRM format that was
supported by Acrobat and Reader 6 and
7. Digital Editions also supports books from such bookstores and
libraries, as well as migrating legacy
books that were downloaded with
Acrobat/Reader 6 & 7
Note that most online libraries already employ some sort of DRM and it is up to you to choose one. There are various types of DRM and you will have to read up on those and choose one.
Microsoft Reader also supports DRM -- something you may want to check out (if you are going to work with more than PDF files).
However, DRM is a contentious issue and enough controversy has already been created around DRMs -- so be sure if you want to go down this path.
I would strongly recommend you go through the Wikipedia article on DRM to get a fair idea of what you are up against.