简体   繁体   中英

How to display a pdf in a web page from a network share

I wish to display a pdf from a local share when a user clicks on a row. I have a page that gets built by php that retrieves file paths from a database and adds them to a "onclick" event in a table row. I found this question that explains how to display an image from a path. I changed the img tag to this

<embed id='i' width="500" height="375">

and it works with a pdf. I can not get it to work with a path. Is this impossible? It would be nice to display the image in a page but if I can not then can I launch the reader?

I have a fiddle here .

Alternately if I can force the file selection dialog to display the path and make the user click "ok" would be acceptable. A little kludgy, but acceptable.

Do you can to put the pdf in a object tag http://www.w3schools.com/tags/tag_object.asp,do you can do this in php in this way

      $selelect = mysql_query("Your select...");   
    while($row = mysql_feech_array($selelect)){

        echo '<object data="'.$row['way..'].'" type="application/pdf" width="300" height="200"> 
alt : <a href="Name">Name.pdf</a> </object>';   
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM