How To Embed Pdf File In View

Heys guys,

can anyone assist me on how to embed pdf files in the view. tried this but nothing


<embed src="<?php echo Yii::app()->request->baseUrl; ?>/../uploads/admin_avatar.pdf" width="90" height="50"><br>

check this

<script type=‘text/javascript’>

function embedPDF(){

var myPDF = new PDFObject({ 





  url: 'URL'





}).embed('URL'); 


// Be sure your document contains an element with the ID 'fff' 

}

window.onload = embedPDF; //Feel free to replace window.onload if needed.

</script>

Hey dude, Am new to yii and havent mastered the framework very well. Please help me understand how to use this script you have posted to embed the pdf

Hm, dunno. Something’s telling me an iframe could do here. Just be careful as not all browsers are capable of displaying PDFs.

Or perhaps you can use Google Docs viewer:


<iframe src="http://docs.google.com/gview?url=...&embedded=true" frameborder="0"></iframe>