[How to] Add “Save as PDF” Button to your Website?

Mon, Sep 29, 2008

Tutorial  




If you are wondering how you can make your website or blog visitors save the web articles as PDF documents, then you must check out PDF online.

logo

You just need to add a small JavaScript snippet in the blog templates, visitors can click the “Save Page as PDF” button and the current web page will be rendered as a PDF document.

The site is still in beta, but you can test out the service by using the script below

<
function savePageAsPDF() {
var pURL = "http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=" + escape(document.location.href);
w indow.open(pURL, "PDFOnline", "scrollbars=yes, resizable=yes,width=640, height=480,menubar,toolbar,location");
>

Save Page As PDF

If you are allergic to deal with JavaScript, then you can directly embed the URLs in your blog posts without using any JavaScript. Just use the following values for cURL instead of encodeURIComponent(document.location.href)

Classic Blogger – <$BlogItemPermalinkURL$>
Blogger XML Template – data:post.url
WordPress


If you enjoyed this post, make sure you subscribe to my RSS feed!

Related Posts:

  1. Make Any Website Editable by Executing a simple JavaScript
  2. How to Promote a New Blog/Website Via Guest Blogging?
  3. [How to] Create a Favicon for Your Website
  4. [Tiny Tip] Reading the CSS File of a Website
  5. [Tiny Tip] Save Battery Life of Your Digital Camera





, , ,

1 Comments For This Post

  1. Bang Del Says:

    Thank you. I’ve looking for this tutorial and I now it.

    [Reply]

Leave a Reply