Senior & Expert PHP Developers Discussion Forum by Nyros Technologies

HIRE PHP Expert Developers Programmers Coders From India
PHP .Net Ruby on Rails Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Print document using Javascript

 
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> Javascript
View previous topic :: View next topic  
Author Message
Thirupathi



Joined: 01 Dec 2009
Posts: 70

PostPosted: Thu Feb 04, 2010 9:31 am    Post subject: Print document using Javascript Reply with quote

Hi Friends,I have posted one javascript program which will give an idea about how to print the document.I think if might be helpful to you.

printdoc.html
----------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Untitled Document</title>
<script type="text/javascript" >
function varitext(text){
text=document
print(text);
}
</script>
</head>

<BODY>
<h3>This is the sample javascript program</h3>
<DIV ALIGN="CENTER">
<FORM>
<!--This is one type of syntax for print the document using javascript -->
<INPUT NAME="print" TYPE="button" VALUE="Print this Document!" ONCLICK="varitext()">
</FORM>
</DIV>

<!--This is another type of syntax for print the document using javascript with href link -->
<A HREF="javascript:window.print()">Click to Print This Page</A>

<!-- This is the syntax for print the document using javascript with href and image-->

<A HREF="javascript:window.print()"><img src="print_image.gif" /></A>
</body>
</html>

Thanks & Regards,
Thirupathi.J
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> Javascript
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts Upload large file using htaccess file in php
0 AnilKumar 11 Fri Mar 19, 2010 7:06 am
AnilKumar View latest post
No new posts subtracting tha dates from present date using php
0 rajkumar 13 Fri Mar 19, 2010 4:58 am
rajkumar View latest post
No new posts How to change Admin theme in drupal
0 Thirupathi 12 Fri Mar 19, 2010 4:48 am
Thirupathi View latest post
No new posts problem with plesk
1 Sanjana 15 Fri Mar 19, 2010 4:41 am
rajkumar View latest post
No new posts Pagination in smarty using php and mysql
0 AnilKumar 16 Fri Mar 19, 2010 4:06 am
AnilKumar View latest post
No new posts highlet source code in php application
0 Sanjana 21 Thu Mar 18, 2010 11:04 am
Sanjana View latest post
No new posts Get the status from twitter using PHP script
1 Thirupathi 36 Tue Mar 16, 2010 4:41 am
Phani Kumar View latest post
No new posts Error: CakephpController could not be found.
0 Mike 19 Tue Mar 16, 2010 4:21 am
Mike View latest post
No new posts cake php
2 Mike 40 Mon Mar 15, 2010 11:46 am
Mike View latest post
No new posts Problem to create a folder in my server
1 samir 21 Mon Mar 15, 2010 7:32 am
rajkumar View latest post





Hire an expert PHP developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   .Net   |   Free unlimited HTML CSS Joomla Wordpress Drupal templates download

Nyros Technologies   |   Developers Blog   |   Kakinada City Portal   |   About PHP Experts   |   More