How To Add Print as PDF Button in Your Blogger or WordPress Site

Print as PDF is a helpful tool to save the Page as PDF. It is done for the purpose of visitors solely. If you keep writing useful post then your visitor may want to save the Page as PDF to read later. There are many Add-on in the browser available for that job. But everyone does not have the Add-on. So it will be great if you give them the choice to download your page as PDF. There are plugins for WordPress site but if you don’t want to use plugin then this is the right option for you.

Add Print as PDF Button in Your Blog

See the Demo of Print as PDF Button

How to Download The PDF?

Click on the PDF button. There will be a Pop Up and download button. there are many options there like as “Click to Delete” Remove image etc. There are Ads ! That the back end of this thing.

Add Print as PDF Button in Your Blog

How To Add Print as PDF Button for Blogger:

  • Go to > Blogger Dashboard
  • Click Layout
  • Click Add Gadget and select HTML/JavaScript
  • Copy and Paste the following code

<script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><script type="text/javascript">document.doAT = function(cl){var myclass = new RegExp("hentry");var myTitleContainer = new RegExp("post-title");var myPostContent = new RegExp("post-footer");var elem = this.getElementsByTagName("div");for (var i = 0; i < elem.length; i++){var classes = elem[i].className;if (myclass.test(classes)){var container = elem[i];for (var b = 0; b < container.childNodes.length; b++){var item = container.childNodes[b].className;if (myTitleContainer.test(item)){var link = container.childNodes[b].getElementsByTagName("a");if (typeof(link[0]) != "undefined"){var url = link[0].href;var index_page = true;}else{var url = document.url;var index_page = false;}if (typeof(url) == "undefined"|| url == "undefined" ){url = window.location.href;var index_page = false;}}if (myPostContent.test(item)){var footer = container.childNodes[b];}}var n = document.createElement("div");if (index_page == true) {var at = '<a href=' + url + '?pfstyle=wp' + ' style="float:right; margin-right: 1em; color:#6D9F00; text-decoration:none;" class="printfriendly" title="Printer Friendly and PDF"><img style="border:none;" src="http://cdn.printfriendly.com/button-print-grnw20.png" alt="Print Friendly and PDF"/></a>';}else {var at = '<a href="http://www.printfriendly.com" style="float:right; margin-right: 1em; color:#6D9F00; text-decoration:none;" class="printfriendly" onclick="window.print(); return false;" title="Printer Friendly and PDF"><img style="border:none;" src="http://cdn.printfriendly.com/button-print-grnw20.png" alt="Print Friendly and PDF"/></a>';}n.innerHTML = at;var origFooter = footer.innerHTML;footer.innerHTML = n.innerHTML + origFooter;footer.style.overflow = "hidden";}}return true;};document.doAT("hentry");</script>

How To Add Print as PDF Button for WordPress:

  • Go to your WordPress Dashboard
  • Click on Appearance
  • Click on Widget
  • Drag and Drop Text to the Sidebar.
  • Copy and Paste the following code

<script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" style=" color:#6D9F00; text-decoration:none;" class="printfriendly" onclick="window.print(); return false;" title="Printer Friendly and PDF"><img style="border:none;" src="http://cdn.printfriendly.com/button-print-grnw20.png" alt="Print Friendly and PDF"/></a>

If you have problem regarding to add this, let me know in the comment.

Check Also

Add Visitor Counter Widget In Your Blogspot or WordPress Blog Without Plugin

Visitor Counter is essential to show your reader is that how much popular your blog …