PDF Embed Tutorial
You can use the following shortcode to embed a PDF file to WordPress posts or pages:
The PDF URL must comply with the following requirements:
- The PDF URL is defined with the src attribute.
- The PDF file MUST be hosted on the SAME DOMAIN as your WordPress website.
- The PDF URL MUST be an absolute URL, that’s, the URL must start with http:// or https://.
- Make sure there are no special characters in the PDF URL, for example, apostrophes, double quotes, accented letters etc.
- You can use px or % for the width and height attributes, for example, 600px or 100%.
- By using % for the width attribute, the PDF viewer will be responsive.
- If you use 100% for the height attribute, make sure the container of the shortcode has a proper height value.
- You can use the style attribute to define the CSS style of the PDF viewer which is an iframe.