Connecting Tech Pros Worldwide Forums | Help | Site Map

Displaying a PDF from PHP

Joe Trubisz
Guest
 
Posts: n/a
#1: Jul 17 '05
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

Justin Koivisto
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Displaying a PDF from PHP


Joe Trubisz wrote:
[color=blue]
> 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??[/color]

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

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

Matthew Crouch
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Displaying a PDF from PHP


or

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

"Joe Trubisz" <trubisz@yahoo.com> wrote in message
news:89cfa378.0311121102.32224f54@posting.google.c om...[color=blue]
> 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[/color]


Kafooey
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Displaying a PDF from PHP


On 12 Nov 2003 11:02:58 -0800, trubisz@yahoo.com (Joe Trubisz) wrote:
[color=blue]
>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.[/color]

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 :)
FLEB
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Displaying a PDF from PHP


On 12 Nov 2003 11:02:58 -0800, Joe Trubisz wrote:
[color=blue]
> 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[/color]

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
Closed Thread