html javascript print command

html javascript print command

am 12.04.2008 03:21:02 von tigeressal

hi,
im new to this group but ill be direct to the point.

im tryin to create a simple webpage that will print the contents of
the webpage to a printer on a client side machine.

i know the command is ' window.print() ' and that i can have it in
the ' onload() ' statement so that the print dialouge appears prior to
printing.

here my question. how do i eliminate the Header and Footer information
that is automatically generated by the webpage?(i.e. the website name
at the top, and the location url at the bottom)

any help appreciated.

regards

rak

Re: html javascript print command

am 12.04.2008 04:06:00 von lws4art

tigeressal wrote:
> hi,
> im new to this group but ill be direct to the point.
>
> im tryin to create a simple webpage that will print the contents of
> the webpage to a printer on a client side machine.
>
> i know the command is ' window.print() ' and that i can have it in
> the ' onload() ' statement so that the print dialouge appears prior to
> printing.

I wouldn't recommend it. Folks who browse the web expect to *see* a page
when it loads, if they want to print it they will click print from their
browser. Anyway what if they don't have a printer? Maybe they are view
the page from on of those iPhones...


> here my question. how do i eliminate the Header and Footer information
> that is automatically generated by the webpage?(i.e. the website name
> at the top, and the location url at the bottom)

You cannot, those are user settings on the browser. You cannot script them.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Re: html javascript print command

am 12.04.2008 04:18:46 von PW

"tigeressal" wrote in message
news:d55be8e6-f177-4337-b2d2-e5f0eede7ec4@b64g2000hsa.google groups.com...
> hi,
> im new to this group but ill be direct to the point.
>
> im tryin to create a simple webpage that will print the contents of
> the webpage to a printer on a client side machine.
>
> i know the command is ' window.print() ' and that i can have it in
> the ' onload() ' statement so that the print dialouge appears prior to
> printing.
>
> here my question. how do i eliminate the Header and Footer information
> that is automatically generated by the webpage?(i.e. the website name
> at the top, and the location url at the bottom)
>
> any help appreciated.
>
> regards
>
> rak




First, create a style like this ...




Next, whenever you are serving something that you don't want to be printed,
place it in a paragraph like this ...
(this is my print button by the way)







Now, when you run the page, and you click the button, then everything thats
NOT within a 'dontprintme' paragraph will not be printed.

HTH,
PW

Re: html javascript print command

am 12.04.2008 04:34:41 von PW

>
> First, create a style like this ...
>
>
>
>
> Next, whenever you are serving something that you don't want to be
> printed, place it in a paragraph like this ...
> (this is my print button by the way)
>


>
>


>
>
>
> Now, when you run the page, and you click the button, then everything
> thats NOT within a 'dontprintme' paragraph will not be printed.
>
> HTH,
> PW
>


OOPS, that should have said ...
Now, when you run the page, and you click the button, then everything thats
NOT within a 'dontprintme' paragraph WILL be printed.

Re: html javascript print command

am 12.04.2008 04:35:05 von lws4art

PW wrote:
> "tigeressal" wrote in message
> news:d55be8e6-f177-4337-b2d2-e5f0eede7ec4@b64g2000hsa.google groups.com...
>> hi,
>> im new to this group but ill be direct to the point.
>>
>> im tryin to create a simple webpage that will print the contents of
>> the webpage to a printer on a client side machine.
>>
>> i know the command is ' window.print() ' and that i can have it in
>> the ' onload() ' statement so that the print dialouge appears prior to
>> printing.
>>
>> here my question. how do i eliminate the Header and Footer information
>> that is automatically generated by the webpage?(i.e. the website name
>> at the top, and the location url at the bottom)
>>
>> any help appreciated.
>>
>> regards
>>
>> rak
>
>
>
>
> First, create a style like this ...
>
>
>
>
> Next, whenever you are serving something that you don't want to be printed,
> place it in a paragraph like this ...
> (this is my print button by the way)
>


>
>



Ah, but what OP want to excluded is not part of his web page that he
composed but the URL and date and page numbers that is added by the
browser by default. This is a user setting on the browser and is not
controllable by the web author...at least with HTML and CSS


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Re: html javascript print command

am 12.04.2008 18:55:22 von Sid Ismail

On Fri, 11 Apr 2008 22:35:05 -0400, "Jonathan N. Little"
wrote:

: >
: >
: >
: >
: >
: > Next, whenever you are serving something that you don't want to be printed,
: > place it in a paragraph like this ...
: > (this is my print button by the way)
: >


: >
: >


:
: Ah, but what OP want to excluded is not part of his web page that he
: composed but the URL and date and page numbers that is added by the
: browser by default. This is a user setting on the browser and is not
: controllable by the web author...at least with HTML and CSS


The easiest way for the OP to achieve this would be to PDF it.

Sid

Re: html javascript print command

am 12.04.2008 22:41:57 von tigeressal

On Apr 12, 3:35=A0am, "Jonathan N. Little" wrote:
> PW wrote:
> > "tigeressal" wrote in message
> >news:d55be8e6-f177-4337-b2d2-e5f0eede7ec4@b64g2000hsa.googl egroups.com...=


snipped

> >> rak
>
> > First, create a style like this ...
> >