The problem was that when I displayed the PDF, it would not be responsive for mobile view. iframe stands for inline frame, and it allows you to embed another HTML document within the current one. Just ensure that you have permission to use and share the PDF content if it is not your original work. The best way I found to display a PDF was to use an iframe.
Once you have pasted the embedding code into your post or page, you can publish the post or update the page to see the embedded PDF.īy following these steps, you can embed a PDF in your WordPress website without using a plugin. The width attribute should be set to “100%” for responsiveness, and you can adjust the height value as needed. You can adjust the width and height attributes in the tag according to your preference. If there is a free plugin or a function in Bootstrap to make this happen, I would be happy to hear about it. It needs to be responsive, so the PDF should scale with the device width so that the PDF document displays a complete page. Replace the URL inside the src attribute with the URL of your PDF file. I need to scale a PDF file to fit the iFrame. To embed the PDF as an iframe, you can use the following HTML code.Paste the copied URL into the editor where you want the PDF to appear.Create a new post or edit an existing one where you want to embed the PDF.
Copy the link of the PDF from the “Copy Link” field.Click on the PDF you uploaded to open it and see its details.After uploading the PDF, go to the “Media Library” tab.To embed a PDF in WordPress without using a plugin, you can follow these steps: Embedding a PDF in WordPress without using a plugin allows for greater control over website performance and reduces reliance on additional third-party software. In this tutorial, you will explore how to embed a pdf in WordPress without using Plugin.