Tools to Capture and Convert the Web
GrabzIt Save As PDF Plugin

How to use the Save As PDF Plugin

The Save As PDF Plugin Plugin adds the ability to save any web page as PDF on any website, CMS or blog. Such as WordPress, Drupal and Joomla.

Just add the class grabzit-pdf-save to an HTML element such as a link, button or image. When the user clicks on the HTML element, the browser downloads the current web page in the PDF file format. This allows your users to read a good offline version of your web page at a later date.

First, place the line below at the bottom of the page just above the closing body tag. Then replace the "APPLICATION KEY" with your actual application key.

new GrabzItSaveAsPDF("Sign in to view your Application Key");

Next, to add the ability to convert a web page to the PDF format, to your web page. Simply add the grabzit-pdf-save class to an HTML element such as a link. This will automatically read and generate a download of the web page when someone clicks on the HTML element.

You do not have to set any other configurations options other than that. However you can specify all of the general and PDF parameters in the options object.

When you save a web page, the system automatically names the downloaded PDF file after the title of the web page. However in the below example we have set the filename of the download to be mypage.pdf instead.

new GrabzItSaveAsPDF("Sign in to view your Application Key", {"filename": "mypage.pdf"});

To download something other than the current page. You can specify a different URL by using the grabzit-url attribute for instance.

<a href="#" grabzit-url="" class="grabzit-pdf-save">Save as PDF</a>

While you are of course free to alter the JavaScript or CSS as you wish! The Save As PDF Plugin does provide special CSS classes that you can use to style the preview box.

These include the grabzit-pdf-save-progress. This specifies the style of the element with the grabzit-pdf-save class during PDF generation. By default the HTML element appears disabled while GrabzIt creates the PDF. You can easily change this.

Installing GrabzIt Save As PDF on a Blog or CMS

GrabzIt's Save As PDF plugin is fully compatible with a blog or CMS. Just open blog-or-cms-install.txt found in the plugin download, this includes all the required JavaScript and CSS in one block. You can then insert this into a widget that accepts raw HTML.

Such widgets are present in most blog or Content Management Systems. Remember to locate it at the bottom of the page after the content. This enables all the HTML elements decorated with the special CSS class.

Download Now

This JavaScript plugin is completely open source! To view or improve the source code you can find it on GitHub.