Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Function

Status
Not open for further replies.

svsuthar1

Programmer
Jul 6, 2004
135
US
What does print function do and how can you set it up. Can you setup the oriantation and selection category when you use this function....

Second part to do this... how is printer friendly pages is written... is it basically re-written again as separate html or is there such function for that also.

Samir
 
>>Second part to do this... how is printer friendly pages is written... is it basically re-written again as separate html or is there such function for that also.


both, sometimes its a seperate HTML but sometimes it can be controlled by css (print media)...

Known is handfull, Unknown is worldfull
 
First part:

You cannot set any printer properties using JavaScript, such as orientation, paper size, printer source, etc.

You'll need to use an ActiveX control to do this, which I recommend not doing.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
what type of css media is used to control it... I have css sheet, but i am not fluent in it can you help me understand what you mean by but sometimes it can be controlled by css (print media)...

Samir
 
svsu -

you can define different css styles for printing and for the screen. here's a basic example:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]

<html>
<head>
<title>new document</title>

<style type="text/css" media="screen">

#main {
    font-weight: bold;
	font-size: 50px;
	font-family: 'Courier New';
	color: red;
}

</style>

<style type="text/css" media="print">

#main {
    font-weight: normal;
	font-size: 20px;
	font-family: 'Trebuchet MS';
	color: black;
}

</style>

</head>

<body>

<div id="main">
    Hello there!  Here is some test text.  When you print this it will be 20 pixels high, black, in a different font (Trebuchet MS) and not bold.
</div>

</body>

</html>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Thank you cLFlaVA... I really appreciate your help.. how hard is to write code to make pdf file for asp... or do i have to use a different form for this.

thanks..

Samir
 
that is beyond my knowledge. maybe vbkris or someone else can offer some help there.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
>>how hard is to write code to make pdf file for asp

u may need a component for that, try a search on the web...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top