How to Embed PDF in Website Using HTML

In this article, we discuss How to Embed PDF in Website Using HTML. In HTML there are 3 ways to embed PDF in HTML.

How to Embed PDF in Website Using HTML

3 Ways to Embed PDF in Website using HTML

  1. Using <object> tag.
  2. Using <embed> tag.
  3. Using <iframe> tag

Embed PDF using <iframe> in HTML

Using <iframe> you can set height and width of the PDF.

HTML tag has some attributes which are used to manage the embed PDF on the HTML <iframe>. Attributes are explained below,

  • src – here you can set the path of the external file to embed.
  • type – here you can set the media type of the embedded content.
  • width – here you can specify the width of the embedded content.
  • height – here you can set the height of the embedded content.

Syntax of HTML PDF embed using <embed> tag

PDF embed code

Using HTML object PDF embed operation,

Above we do the PDF embed operation using different tags of HTML.

Note:
Using <embed> and <object> tag is old fashioned and also considered as deprecated.

So, we using <iframe> for PDF embed on our website, which is an easy way to do the same.

I hope, I cleared all the things about how PDFs are embedding on the HTML website using <iframe> HTML tag.

If you guys facing any issue on this please let me know on comments.

On Medium: https://medium.com/@phpcodertech/3-ways-to-embed-pdf-in-website-using-html-d3cddff696be?sk=2db1b98c8e1021d884cb637de068c2df

Also Check:

Happy Coding..!

Subscribe For Latest Updates

Sign up to best of PHP Code Solutions, informed analysis and opinions on what matters to you.
Invalid email address
We promise not to spam you. You can unsubscribe at any time.

About Bikash

My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH, my native place in Odisha. I am a Web Programmer by profession and working on more than 50 projects to date. My passion is working on the web-based project using PHP and relate to all CMS and frameworks which is based on PHP.
View all posts by Bikash →

1 thought on “How to Embed PDF in Website Using HTML

Leave a Reply

Your email address will not be published. Required fields are marked *