Want site visitors to print or download your blog posts as PDF documents ?
PDF Online, the free PDF conversion service that helps you create PDF files of your Microsoft Office documents, has released a new online tool for converting HTML web pages to PDFs.
Here's how the new service works - bloggers 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.
Though the "SavePagesAsPDF" service is in closed beta, you can still give it a try as show below:
<script type="text/javascript">
function savePageAsPDF() {
var pURL = "http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=" + escape(document.location.href);
window.open(pURL, "PDFOnline", "scrollbars=yes, resizable=yes,width=640, height=480,menubar,toolbar,location");
</script>
<a href="javascript:savePageAsPDF()">Save Page As PDF</a>
Real Example - Print Google.com as PDF
When the SavePageAsPDF service goes live officially, you will be able to track all the PDF conversion activities on your website helping you visualize the most popular content on your blog.
More on the service at pdfonline.com/ and pdfonline.blogspot.com/.
This will be in direct competition with HP Print Widget that also allow printing blog posts and RSS feeds as PDF documents.
Related: CSS for Printer Friendly Web Pages
Update: You can directly embed the URLs in your blog posts without using any javascript. Use the following values for cURL instead of encodeURIComponent(document.location.href)
Classic Blogger - <$BlogItemPermalinkURL$>
Blogger XML Template - data:post.url
WordPress - <?php the_permalink();?>
Find this article at: http://labnol.blogspot.com/2007/06/add-as-pdf-button-to-your-websites-and.html
web: http://www.labnol.org/ email: amit@labnol.org

Reader Comments
Hey Amit thats cool if we see a good post of article we want to save it for future reference...we cant able to save it so we turned to bookmark the page....some time when we click on the bookmarked page...the page never show up....this is good option
Written on 21/6/07 2:13 PM
Hey amit
why don't you provide the link save as pdf for your readers help
Written on 21/6/07 9:30 PM
Save trees, print as pdf :)
Written on 23/6/07 1:20 AM
Hi Amit,
Thanks for the useful information. You had answered my query as i was searching for this option.
thanks---
geetanjali bhardwaj
Written on 26/6/07 5:30 PM
Hey Amit, Thanks a lot for this.
Written on 16/7/07 5:33 AM
Hey,
Thanks a lot for the info.
I have troubles to implement this tool for my blog (i'd like to add "save as pdf" for each post).
Could you explain me how to do it?
Thanks in advance for your help,
Aure.
Written on 23/7/07 8:43 PM