I am trying to create a script to display pdf docs for a library. On my Linux box, I have the pdfs stored in /var/www/Library/. In other words, at the same level as the html folder (web root) at /var/www/html. I split each book into one pdf per page for improved indexing and display. So, for example, there is a folder named: /var/www/Library/CATJ_1903 with about 300 individual pdfs page_001.pdf page_002.pdf …
How can I display a pdf page from that level? I want to use an IFRAME or AJAX and a div for displaying the pdf. And navigation links to the next/previous page in the book. When a navigation ink is clicked, I want to retrieve and display the desired pdf in the Iframe or div. If I try to use readfile, it sends the pdf's binary code and not the viewable pdf. And, since the pdfs are above the web root, I can't get to them directly. (I put the books there for security, the Library wants to make its research library publicly available, but does not want someone to download/steal the entire collection)
It looks like I nead to "read" the pdf from its current location and then somehow echo it out to the browser. Any ideas would be greatly appreciated.
Brad