...

View Full Version : opening pdf with acrobat....



hanpedro
07-08-2005, 09:02 AM
Without <a href..>, I want to open pdf file with acrobat reader.

I tried,

echo "aaa.pdf";

the msie shows error message.

Any comment would be appreciated.

Fou-Lu
07-08-2005, 09:10 AM
Maybe something like:


<?php
header("Content-type: application/pdf");


$file = file_get_contents('aaa.pdf');
echo $file;
?>

will work?

Never used php to open a pdf before, but I'd think that the direct output with the content-type header will probably do the trick. Only one way to find out...

hanpedro
07-08-2005, 09:16 AM
Dear Fou-Lu,

Thanks a lot for your speedy and favorable comment.
I will study and post result.

:thumbsup:

Fou-Lu
07-08-2005, 09:18 AM
no problem, let me know if it works, if not I'll try to throw something together for you.

hanpedro
07-08-2005, 10:34 AM
Dear Fou-Lu

I wrote ::

<?php
header("Content-type: application/pdf");


$file = file_get_contents('../pdf/2003.pdf');
echo $file;
?>

But the result is empty page.

Fou-Lu
07-08-2005, 08:27 PM
Hmm, don't know what to tell you, this is what I used to test it with:


header("Content-type: application/pdf");

$file = file_get_contents('./form.pdf');

echo $file;


the only real difference is my file location. So... I'm thinking the file path within your file_get_contents() is incorrect. Oh, of course this depends on your browser as well, some will display within your browser page (IE for example), some will prompt an application download.
Under the assumption that your posting had been a complete script, just varify your file path is correct.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum