By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Displaying a PDF from PHP

P: n/a
Hi...

Problem: I have PDF's sitting on somewhere (not on the client), and,
using a database command, a selection list of what PDF's they have
stashed is displayed. When the person selects the PDF they want
displayed, I want to do *something* in PHP which allows me to display
the PDF on their screen.

Problem is: have absolutely no idea if this is even possible, or if it
is, how to go about it.

Anyone have a suggestion??

Thanks in advance,
Joe
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Joe Trubisz wrote:
Hi...

Problem: I have PDF's sitting on somewhere (not on the client), and,
using a database command, a selection list of what PDF's they have
stashed is displayed. When the person selects the PDF they want
displayed, I want to do *something* in PHP which allows me to display
the PDF on their screen.

Problem is: have absolutely no idea if this is even possible, or if it
is, how to go about it.

Anyone have a suggestion??


http://us3.php.net/fpassthru would be a good place to start reading.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2

P: n/a
or

http://www.php.net/manual/en/ref.pdf.php

"Joe Trubisz" <tr*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
Hi...

Problem: I have PDF's sitting on somewhere (not on the client), and,
using a database command, a selection list of what PDF's they have
stashed is displayed. When the person selects the PDF they want
displayed, I want to do *something* in PHP which allows me to display
the PDF on their screen.

Problem is: have absolutely no idea if this is even possible, or if it
is, how to go about it.

Anyone have a suggestion??

Thanks in advance,
Joe

Jul 17 '05 #3

P: n/a
On 12 Nov 2003 11:02:58 -0800, tr*****@yahoo.com (Joe Trubisz) wrote:
Hi...

Problem: I have PDF's sitting on somewhere (not on the client), and,
using a database command, a selection list of what PDF's they have
stashed is displayed. When the person selects the PDF they want
displayed, I want to do *something* in PHP which allows me to display
the PDF on their screen.

Problem is: have absolutely no idea if this is even possible, or if it
is, how to go about it.


I would do this by having a cache directory within your web root, and
write the code to (a) move the PDF file to the cache directory
(re-naming it on the way to something unique), and then (b) call
header() and redirect to the file...

You could open the PDF file as a stream and deliver it to the client
too, but I like the cache method myself - for instance, if you had a
hundred people looking at the same PDF, if you keep a little database
table of what is in the cache, you only cache one file and deliver it
a hundred times.

Just my two penneth :)
Jul 17 '05 #4

P: n/a
On 12 Nov 2003 11:02:58 -0800, Joe Trubisz wrote:
Hi...

Problem: I have PDF's sitting on somewhere (not on the client), and,
using a database command, a selection list of what PDF's they have
stashed is displayed. When the person selects the PDF they want
displayed, I want to do *something* in PHP which allows me to display
the PDF on their screen.

Problem is: have absolutely no idea if this is even possible, or if it
is, how to go about it.

Anyone have a suggestion??

Thanks in advance,
Joe


Assuming the client has Acrobat, can't you just redirect them to where the
PDF is stored? Or, if it's in a non-web location, make a cache-copy
somewhere linkable and redirect to that.

If you're not assuming they have Acrobat (You want to PDF->HTML), then
that's out of my league.

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.