Adding a PrintWhatYouLike Link

 

Conventional web 1.0 design recommended that webmasters make a single consistently printable version of your web page.  Dynamic, user-centered content such as DataPages can makes this approach impractical if not obsolete.  Several web services have been created to help users isolate and print only the portion of the webpage desired.

This article shows you how to create a PrintWhatYouLike link.  This service is entirely web-based and is available for free.  This software has many advantages over the standard print function of a browser, including the ability to save a streamlined webpage to a PDF or HTML page.  For convenience we have also included a customizable JavaScript alert with some basic instructions.

Print What You Like Link

Click Here to see an example.  This DataPage displays 250 records at a time.  By hiding the background and the margins the printed page count is reduced from 10 pages to only 4.

Steps to adding a Print What You Like link:

Add a header and footer section to your DataPage.  Copy and paste the following code into the header or footer sections or both.  You can update the alert instructions (in red) as needed.

<a href="javascript:(function(){
if(window['ppw']&&ppw['bookmarklet']){
ppw.bookmarklet.toggle();
}
else{
window._pwyl_home='http://www.printwhatyoulike.com/';
window._pwyl_pro_id=null;
window._pwyl_bmkl=document.createElement('script');
window._pwyl_bmkl.setAttribute('type','text/javascript');
window._pwyl_bmkl.setAttribute('src',window._pwyl_home+'static/compressed/pwyl_bookmarklet_10.js');
window._pwyl_bmkl.setAttribute('pwyl','true');document.getElementsByTagName('head')[0].appendChild(window._pwyl_bmkl);
}})();
alert('
Using the panel on the Left:n
The background, images and margins can be hidden if needed. n
Select an area you would like to print and click Isolate.n
Select an area and click Remove to remove any unwanted sections.n
Click Print or Save As when finished.

');
">Print this Data</a>

Basic Print Button

If you would like a basic print button that will print out everything on the current webpage, you can just insert the following code into the header or footer of your DataPage:

<input type="button" value=" Print this page " onclick="window.print();return false;" />

Which creates a regular HTML button:

Note Please note: This article uses external HTML, JavaScript, or third-party solutions to add functionality outside of Caspio Bridge's standard feature set. These solutions are provided "as is" without warranty, support or guarantee. The code within this article is provided as a sample to assist you in the customization of your web applications. You may need a basic understanding of HTML and JavaScript to implement successfully.