Advice for design using PDF files in PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
glebreck
Forum Newbie
Posts: 2
Joined: Wed May 19, 2004 12:04 pm

Advice for design using PDF files in PHP

Post by glebreck »

Hey guys a little new to PHP. My backgroung is in ASP but I'm making the switch.

I have a problem I am trying to solve for a custmer. They have a large PDF file which they upload to a database I have created for thier site. Rather than just a link to the PDF file they would like to display it's contents on the web page(s).

Now I have tried embedding the PDF to the page but it still must load the whole thing, not good considering most of their users are dial up.

Is there a way create the html within a PHP page from the pdf file in their site. The PDF will change so it needs to be dynamic, but I need links and all.

Is this even possible?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

glebreck
Forum Newbie
Posts: 2
Joined: Wed May 19, 2004 12:04 pm

I don't think thats the right thing

Post by glebreck »

From what I understand from the link you sent that is for creating PDF from Php. I want to take a PDF and put into a PHP page!

Thanks Though
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

pdf is like any media.. so all you have to do is to upload it on your server and put an html link to it.. there no php involved in that

Code: Select all

ex :
<a href="path/to/my/pdf.pdf">Click here</a> to read pdf
and that's it
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Perhaps glebreck talking about something like Google's "View as HTML" for pdfs....
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

The most efficient way to manage this might be a single data source which (using php) can serve up the content in either format - if that's possible in your set up? The php app could run on an office network or on a web site.

I should say I haven't mucked about with pdf from php myself so I couldn't say how well it works in practice.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there's always writing your own reader:
http://partners.adobe.com/asn/acrobat/s ... e15_v5.pdf WARNING: 13.5MB
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

To view a PDF inline, you'll have to pass it the correct [php_man]header[/php_man]. If you scroll down a little bit, you'll find a section dedicated to PDF.

Personally, I have relied on ezPDF to do pretty much everything for me (incl. headers) and it works beautifully.

------------------
Edit: oops - misunderstood your post. Converting PDF to HTML or any such thing, hmm... a google-search turned up quite a number of links for that. Aparently there is an app called "pdf2html" - a linux rpm which you could use from PHP with [php_man]exec[/php_man]. Would be interested in which package you'd chose - let us know :)
Post Reply