How to embed PDF in HTML?

Spread the love

Sometimes, we want to embed PDF in HTML.

In this article, we’ll look at how to embed PDF in HTML.

How to embed PDF in HTML?

To embed PDF in HTML, we can use the embed element.

For instance, we write

<embed
  src="https://drive.google.com/viewerng/
viewer?embedded=true&url=http://example.com/the.pdf"
  width="500"
  height="375"
/>

to add an embed element with the src attribute set to the PDF URL.

Then we set width and height to the dimensions we want the PDF to have.

Conclusion

To embed PDF in HTML, we can use the embed element.

Leave a Reply

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