Hoping someone can assist. Basically have a few pop-up style pages where I would like to give the user the option to print the HTML contents of a page.
That is, I would like to place a hyperlink on these pages that will allow a printer friendly version of the page to be printed to the user’s designated printer.
Sometime around 18/5/08 (at 08:00 -0400) Tonsils said:
I would like to place a hyperlink on these pages that will allow a
printer friendly version of the page to be printed to the user’s
designated printer.
If you want to make a link actually trigger a print command, I
believe this won’t work on most browsers.
If you want to open a print-friendly version of a page, just make
that as a new page - perhaps 750px or so wide, little or no colour,
little or no graphics, a layout that suits viewing in printed US
Letter or A4 format, etc. - and link to that.
You can try this in the Before /HEAD and onload parts of the print-
friendly page. It will do no harm, and will work in a surprisingly
wide range of Mac browsers these days. It has mostly always worked in
Windows.
//before /HEAD
<script type="text/javascript">
function printme(){
if (window.print){
return window.print();
}
return;
}
</script>
//in Page > Extended, click new and add:
(Name:) onload
(Value:) return printme();
Walter
On May 18, 2008, at 10:20 AM, Keith Martin wrote:
Sometime around 18/5/08 (at 08:00 -0400) Tonsils said:
I would like to place a hyperlink on these pages that will allow a
printer friendly version of the page to be printed to the user’s
designated printer.
If you want to make a link actually trigger a print command, I
believe this won’t work on most browsers.
Walter, I stand corrected! I’m marking this very useful note for
future reference.
k
Sometime around 19/5/08 (at 10:02 -0400) Walter Lee Davis said:
You can try this in the Before /HEAD and onload parts of the print-
friendly page. It will do no harm, and will work in a surprisingly
wide range of Mac browsers these days. It has mostly always worked in
Windows.
//before /HEAD
//in Page > Extended, click new and add:
(Name:) onload
(Value:) return printme();