Page 1 of 1

pdf file display

Posted: Mon Jan 26, 2009 3:23 pm
by artaka
i am having problem displaying my pdf files directly on the browser.each time i click on the relative link to the pdf file, i am prompted to download it first before reading it.
but that is not what i want, i want it to display directly as it is on the browser.
i need your help. thanks

Re: pdf file display

Posted: Mon Jan 26, 2009 4:50 pm
by nor0101
You can embed PDF content into valid XHTML by using the <object> tag.

Code: Select all

 
<object data="somefile.pdf" type="application/pdf" width="770" height="500">
    download the document: <a href="somefile.pdf">somefile.pdf</a>
</object>
 
If the user's browser has the appropriate plugins, the document will be embedded into the page. If not, the content inside the object tags will be rendered - in this case, a simple link to the document.

Google search for "embed PDF object" for more examples.