Displaying a PDF from PHP

This is a discussion on Displaying a PDF from PHP within the PHP Language forums, part of the PHP Programming Forums category; Hi... Problem: I have PDF's sitting on somewhere (not on the client), and, using a database command, a selection ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-12-2003
Joe Trubisz
 
Posts: n/a
Default Displaying a PDF from PHP

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
Reply With Quote
  #2 (permalink)  
Old 11-12-2003
Justin Koivisto
 
Posts: n/a
Default Re: Displaying a PDF from PHP

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 - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Reply With Quote
  #3 (permalink)  
Old 11-12-2003
Matthew Crouch
 
Posts: n/a
Default 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...
> 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



Reply With Quote
  #4 (permalink)  
Old 11-13-2003
Kafooey
 
Posts: n/a
Default Re: Displaying a PDF from PHP

On 12 Nov 2003 11:02:58 -0800, trubisz@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 :)
Reply With Quote
  #5 (permalink)  
Old 11-17-2003
FLEB
 
Posts: n/a
Default Re: Displaying a PDF from PHP

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:02 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0