net mvc 3. I want to display the pdf file as a part of aspx page for preview purpose.
i don't want to use IFrame control. can we do this ?
Generally, a hyperlink is used to link a PDF document to display in the browser. An HTML anchor link is the easiest way to display a PDF file. But if you want to display a PDF document on the web page, PDF file needs to be embedded in HTML. The HTML <embed> tag is the best option to embed PDF document on the web page.
I know you said no frames, but Google PDF viewer seems to be the most popular:
<iframe src="http://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true"
style="width:718px; height:700px;" frameborder="0"></iframe>
And you can try:
<embed src="http://yoursite.com/the.pdf" width="500" height="375">
Best Way to Embed PDF in HTML
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With