{"id":1154,"date":"2013-12-07T00:00:37","date_gmt":"2013-12-07T00:00:37","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/vanilla-pdf-embed\/"},"modified":"2016-11-08T05:11:49","modified_gmt":"2016-11-08T05:11:49","slug":"vanilla-pdf-embed","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/vanilla-pdf-embed\/","author":7568104,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.0.8","stable_tag":"trunk","tested":"4.5.0","requires":"3.0.1","requires_php":"","requires_plugins":null,"header_name":"Vanilla PDF Embed","header_author":"Mike Doherty <mike@mikedoherty.ca>","header_description":"","assets_banners_color":"","last_updated":"2016-11-08 05:11:49","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/flattr.com\/profile\/doherty","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/vanilla-pdf-embed\/","header_author_uri":"https:\/\/hashbang.ca","rating":4.6,"author_block_rating":0,"active_installs":3000,"downloads":99421,"num_ratings":32,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"2","2":"1","3":0,"4":"2","5":"27"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":816252,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":816254,"resolution":"2","location":"assets","locale":""}},"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[230,1764],"plugin_category":[50,56],"plugin_contributors":[79000],"plugin_business_model":[],"class_list":["post-1154","plugin","type-plugin","status-publish","hentry","plugin_tags-embed","plugin_tags-pdf","plugin_category-media","plugin_category-social-and-sharing","plugin_contributors-_doherty","plugin_committers-_doherty"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/vanilla-pdf-embed.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/vanilla-pdf-embed\/assets\/screenshot-1.png?rev=816252","caption":""},{"src":"https:\/\/ps.w.org\/vanilla-pdf-embed\/assets\/screenshot-2.png?rev=816254","caption":""}],"raw_content":"<!--section=description-->\n<h3>Basic use<\/h3>\n\n<p>To embed a PDF you've uploaded to your Wordpress site's media\nlibrary, simply put the URL for the attachment page in your\npost on its own line. The PDF will be embedded with the\ndefault settings at that location, as if it were using oEmbed.<\/p>\n\n<h4>Examples:<\/h4>\n\n<pre><code>Post short URL:\n\nhttp:\/\/localhost\/?p=9\n\nAttachment default URL:\n\nhttp:\/\/localhost\/?attachment_id=9\n\nAttachment pretty URL:\n\nhttp:\/\/localhost\/test\/report1\/\n\nMedia direct URL:\n\nhttp:\/\/localhost\/wp-content\/uploads\/2013\/11\/report1.pdf\n<\/code><\/pre>\n\n<p>This doesn't work for PDFs hosted on other websites, or if you\nneed to change the parameters.<\/p>\n\n<h3>Using the <code>[pdf]<\/code> shorttag<\/h3>\n\n<p>If the PDF isn't in your Wordpress site's media library, or if\nyou want to customize any parameters for the embed, then use\nthe <code>[pdf]...[\/pdf]<\/code> shorttag. Between the tags, you'll provide\nthe URL for the PDF to embed. If the PDF is in your Wordpress\nsite's media library, you can either give the attachment page\nURL, or the URL to the PDF file directly.<\/p>\n\n<p>The <code>[pdf]<\/code> shorttag accepts several optional parameters:<\/p>\n\n<ul>\n<li><code>width<\/code> - sets the width of the frame the PDF is embedded in.\nBy default, this is set to 100%.<\/li>\n<li><code>height<\/code> - sets the height of the frame the PDF is embedded\nin. By default, this is unset.<\/li>\n<li><code>title<\/code> - sets the title of the PDF, for use in the fallback\nlink text.<\/li>\n<li><code>open_params<\/code> - sets the <a href=\"https:\/\/partners.adobe.com\/public\/developer\/en\/acrobat\/PDFOpenParameters.pdf\">PDF open params<\/a>\nwhich control how the PDF file is displayed in the embed frame.\nThese are poorly supported in browsers.<\/li>\n<\/ul>\n\n<h4>Examples:<\/h4>\n\n<pre><code>Post short URL: [pdf width=\"200px\"]http:\/\/localhost\/?p=9[\/pdf]\nAttachment default URL: [pdf height=\"500em\"]http:\/\/localhost\/?attachment_id=9[\/pdf]\nAttachment pretty URL: [pdf title=\"Report 1\"]http:\/\/localhost\/test\/report1\/[\/pdf]\nMedia direct URL: [pdf]http:\/\/localhost\/wp-content\/uploads\/2013\/11\/report1.pdf[\/pdf]\nChange PDF open params: [pdf open_params=\"page=10&amp;view=Fit\"]http:\/\/localhost\/?p=9[\/pdf]\n<\/code><\/pre>\n\n<h3>Compatibility<\/h3>\n\n<p>The PDF should be embedded in the page, with the document scaled so it fills the\nembed frame horizontally. Unfortunately, embedding PDFs is not well-supported.<\/p>\n\n<h4>Auto-loading embedded PDFs<\/h4>\n\n<p>Unlike with images, web browsers may not automatically download and display\nembedded PDFs when the page is loaded. For security reasons, some users prefer\nnot to allow the PDF plugin to run unless they trust the website the PDF comes\nfrom. This generally leaves a grey rectangle that the user may click on to allow\nthe PDF to be downloaded and displayed.<\/p>\n\n<h4>PDF open parameters<\/h4>\n\n<p>As of v0.0.8, you can set the <a href=\"https:\/\/partners.adobe.com\/public\/developer\/en\/acrobat\/PDFOpenParameters.pdf\">PDF open parameters<\/a>\nby setting <code>open_params<\/code> in the shortcode, as shown above. This is unlikely to actually\nanything, since PDF open parameters are poorly supported in browsers. But you can try!\nProvide the parameters as a query string: <code>page=1&amp;view=Fit<\/code>. Refer to the Adobe\ndocumentation on what parameters are available.<\/p>\n\n<h4>Chrome<\/h4>\n\n<p>The PDF should be scaled\/zoomed within the embed frame so that the full\nhorizontal width of the paper fills the frame. This is <a href=\"https:\/\/code.google.com\/p\/chromium\/issues\/detail?id=64309\">not\nsupported<\/a> in\nChrome's default PDF viewer, so the document will probably be scaled to 100%,\nwhich may either mean the document doesn't fill the frame, or, more likely, the\ndocument is too wide for the frame, and the right-hand side of the document is\nhidden.<\/p>\n\n<h4>Internet Explorer<\/h4>\n\n<p>Internet Explorer requires a PDF plugin to render embedded PDFs. Generally,\nthat's Adobe Reader. Without such a plugin, the fallback download link will be\nused.<\/p>\n\n<h4>Mobile browsers<\/h4>\n\n<p>In particular, mobile browsers may show a grey box instead of the embedded PDF,\nand will download the file when it is clicked. Other mobile browsers might embed\nthe PDF, but won't allow it to scroll.<\/p>\n\n<h3>Alternatives<\/h3>\n\n<p>Your best alternative is to <strong>not<\/strong> embed PDFs. PDFs are bad for many reasons:\nnot easily indexed by search engines, not easily accessible by readers who use\nassistive technologies, poorly supported by web browsers (as seen above) and so\non. They're just <strong>bad<\/strong> and you should avoid embedding PDFs if you can.<\/p>\n\n<p>If you <em>really<\/em> can't, then you might consider using another solution like\n<a href=\"https:\/\/pdfobject.com\/\">https:\/\/pdfobject.com\/<\/a> or <a href=\"https:\/\/mozillalabs.com\/en-US\/pdfjs\/\">PDF.js<\/a>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>vanilla-pdf-embed.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the \"Plugins\" menu in the WordPress admin panel<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>0.0.8<\/h4>\n\n<ul>\n<li>Add the ability to set PDF open params<\/li>\n<\/ul>\n\n<h4>0.0.7<\/h4>\n\n<ul>\n<li>Fix a couple corner cases - thanks AngelinaBelle!<\/li>\n<\/ul>\n\n<h4>0.0.6<\/h4>\n\n<ul>\n<li>Set a default height of 500em<\/li>\n<\/ul>\n\n<h4>0.0.5<\/h4>\n\n<ul>\n<li>Fix a simple programming error; thanks to firedog341 for the report<\/li>\n<\/ul>\n\n<h4>0.0.4<\/h4>\n\n<ul>\n<li>By default, use a 100% width embed frame<\/li>\n<li>Expanded readme<\/li>\n<\/ul>\n\n<h4>0.0.3<\/h4>\n\n<ul>\n<li>Embed PDFs on attachment pages<\/li>\n<li>Fix a spacing issue for PDFs with no title<\/li>\n<li>Don't use PDF open parameters for the fallback link<\/li>\n<\/ul>\n\n<h4>0.0.2<\/h4>\n\n<ul>\n<li>Don't embed non-PDFs from the media library<\/li>\n<\/ul>\n\n<h4>0.0.1<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Embeds PDFs in your pages and posts, without using JS.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1154"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/_doherty"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1154"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1154"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1154"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1154"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1154"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}