16 October 2009 6 Comments

Javascript Print Page Area

JavaScript Print Page Area  prints the certain portion from you page.
Instead of printing the whole page , this lets you to print only the specified area form the page.

Define the section for print within the page And call the print_sample_report() function to print. Try Demo

Screenshot

You can define the print section with an id.

Example:

<div id=” print_area” ><!–  Print content goes here.. –></div> This is the print section within you HTML code

Now call  DoPrintableSections function  to print.

var e = document.getElementById(“print_area”); // place the id of you print section as paratmer

function DoPrintableSections(wdth,hght,stylesheets,imgsdir,heading)

{

//center(‘overlayss’,'mybox’);  //load lightbix

CreateVirtualCarrier1(“ContentCarrier”);

var e = document.getElementById(“print_area”);

var content = “”;

var cc = document.getElementById(“ContentCarrier”);

cc.innerHTML = e.innerHTML;

content = cc.innerHTML;

OpenPreviewPage(content,wdth,’auto’,stylesheets,imgsdir,heading);

cc.innerHTML=”";

}

Download Javascript Print Page Area

VN:F [1.8.8_1072]
Rating: 6.5/10 (2 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
Javascript Print Page Area6.5102

6 Responses to “Javascript Print Page Area”

  1. Binod Shrestha 27 October 2009 at 10:26 am #

    Great article…i was looking for same stuff from long time. Keep it up my fren…

    UN:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.8_1072]
    Rating: 0 (from 0 votes)
  2. madhav 6 November 2009 at 8:00 am #

    oh! great solution
    really i’ve got a great help from this solution.l
    anybody who have printing problem they can easily use this script and solve the problem

    UN:F [1.8.8_1072]
    Rating: 3.0/5 (1 vote cast)
    UN:F [1.8.8_1072]
    Rating: +1 (from 1 vote)
  3. Alok Pandey 11 November 2009 at 5:08 am #

    As for as JavaScript Print Page Area is concern, this article is really a grate solution. Any one who really need this can use it with little less effort.

    Thanks to Rajesh Tandukar for posting this grate solution.

    UN:F [1.8.8_1072]
    Rating: 3.0/5 (1 vote cast)
    UN:F [1.8.8_1072]
    Rating: +1 (from 1 vote)
  4. admin 11 November 2009 at 5:11 am #

    Thank you all who have used this script in there websites.And thanks for your comments.

    UA:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UA:F [1.8.8_1072]
    Rating: 0 (from 0 votes)
  5. Joe 11 December 2009 at 4:21 pm #

    Thanks Rajesh for the good script
    I used it with great effect :)

    UN:F [1.8.8_1072]
    Rating: 3.0/5 (1 vote cast)
    UN:F [1.8.8_1072]
    Rating: +1 (from 1 vote)
  6. hermes handbags 1 May 2010 at 7:02 am #

    Very good sharing this.

    UN:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.8_1072]
    Rating: +1 (from 1 vote)

Leave a Reply