It's hard to restrict stuff on the Internet (for example, all that people have to do is right click and go to View Source and they can see how the site is setup) but what you're wanting doesn't seem like something that would be terribly difficult to implement. While I'm not able to offer any code on this particular issue, I might be able to offer some suggestions/ideas:
- Encrypt the .pdf and have the program decrypt it
- Put a password on the ftp folder that the .pdf is stored in. The folder password will be hardcoded into the program, that nobody will be able to view.
- Instead of using .pdf, create your own type of document file extension to where your program is the only one in the world that can read it.
- Change the file extension of the .pdf to something random, and have your program change it to the proper one (client-side)
- If somebody were to look at the contents of your site, they would see .pdf's with file extention .blah123 instead of .pdf. In return, their computer wouldn't know how to open a .blah123 file unless they had your program.
- Change the way that the website is ran and/or was created??? (One idea is that the client would download your program which would already contain all of the .pdf content, encrypted/hidden in a way of course) You could have your program check for updates on startup to see if any of the .pdf files had been changed/added/removed.
I think the folder idea is the best bet. There are ways that you can restrict the public from viewing folders on your site, so as long as they're never able to view the source, there's no way they can find out the file name (if you give it a cryptic name) or path.
Good luck! Hopefully other users will look at your post as well. If not (because of my replies, they might think the issue is being taken care of), I would delete this topic and repost it. In which case, I apologize