Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
withhisstripes #1
Print Selected Area Button
Heya,
I am trying to create a button that users can click on to print a
specific text area of the page that I preselect. Does anyone know how to do
that? Here is the code I used to simply print the whole page, it's close to
what I want: <script language="Javascript1.2">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - [url]http://www.javascript-page.com[/url]
var message = "Print this Page";
function printpage() {
window.print();
}
document.write("<form><input type=button "
+"value=\""+message+"\" onClick=\"printpage()\"></form>");
//-->
</script>
withhisstripes Guest
-
Does anyone know of a pluggin to read square inches of a selected area?
We have been manually calcutating this by selecting each spot color and using the calculator for the mulitplication. The accounting dept. needs... -
show area on print only.
Hi, I have an area on a page which I would only like to show when the page is printed, not when viewed on-screen, I know I could do something... -
Print area has no relation to paper or printer selected?
Using Illustrator 10. Printer is a Canon W6200 wide format printer. Media is 20'x24" roll. Ok so i set my art board to be 600(h)x1000(w)mm... -
Print Selected Area
The Print Selected Area checkbox is grayed out. Colour and mono. This is new after removing ScanWizard 5 and replacing it with ScanWizard 5.7.6... -
the selected area is empty
hi all have a problem when i select something and try to copy it it give me the error message : couldnt complete the copy command because the... -
Murray *TMM* #2
Re: Print Selected Area Button
Can't work....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"withhisstripes" <webforumsuser@macromedia.com> wrote in message
news:ded6bi$q0m$1@forums.macromedia.com...> Heya,
> I am trying to create a button that users can click on to print a
> specific text area of the page that I preselect. Does anyone know how to
> do
> that? Here is the code I used to simply print the whole page, it's close
> to
> what I want: <script language="Javascript1.2">
> <!--
> // please keep these lines on when you copy the source
> // made by: Nicolas - [url]http://www.javascript-page.com[/url]
>
> var message = "Print this Page";
>
> function printpage() {
> window.print();
> }
>
> document.write("<form><input type=button "
> +"value=\""+message+"\" onClick=\"printpage()\"></form>");
>
> //-->
> </script>
>
Murray *TMM* Guest
-
rob::db #3
Re: Print Selected Area Button
You could use a print media stylesheet that hides everything apart from the
content you want printing.
withhisstripes wrote:> Heya,
> I am trying to create a button that users can click on to
> print a specific text area of the page that I preselect. Does anyone
> know how to do that? Here is the code I used to simply print the
> whole page, it's close to what I want: <script
> language="Javascript1.2"> <!--
> // please keep these lines on when you copy the source
> // made by: Nicolas - [url]http://www.javascript-page.com[/url]
>
> var message = "Print this Page";
>
> function printpage() {
> window.print();
> }
>
> document.write("<form><input type=button "
> +"value=\""+message+"\" onClick=\"printpage()\"></form>");
>
> //-->
> </script>
rob::db Guest
-
withhisstripes #4
Re: Print Selected Area Button
Yeah, that's exactly what I'd like to do, can you point me to a resource that could show me how to do that?
withhisstripes Guest
-
rob::db #5
Re: Print Selected Area Button
Just create a new stylesheet attached to your document, with media='print'
as a property of the link. The new stylesheet should hide every element on
the page apart from the one your displaying, and I guess possibly move that
element into a sensible location for printing.
withhisstripes wrote:> Yeah, that's exactly what I'd like to do, can you point me to a
> resource that could show me how to do that?
rob::db Guest
-
rilkesf #6
Re: Print Selected Area Button
If all you want to do is grab a certain part of the page, you could also do it
this way:
Wrap all the content you want printed in a <div> tag and give it an 'id'
attribute
Then, put an onClick handler on your 'print-page' link/button and point it to
a javascript function.
Here's the code:
JAVASCRIPT
// this javascript code opens a new window and fills it with everything inside
the selected <div> tag
function printPage(ID) {
var winprint = window.open("","printer","");
var content = document.getElementById(ID).innerHTML;
winprint.document.open();
winprint.document.write('<html><head><title>YOUR TITLE </title><body>');
winprint.document.write(content);
winprint.document.write('</body></html>');
winprint.document.close();
winprint.focus();
}
AND HERE'S THE <html> CODE:
<body>
<div id="print_content">
All the content you want to show up in the new window goes here
</div>
</body>
<a href="#" onClick="printPage('ID');">link/button</a>
where ID matches the id attribute of the <div> .. in this case 'print_content'
As a sidenote, the code for the link button does not have to be placed outside
of the <div> tag; it can be anywhere between <body> and </body>
rilkesf Guest
-
Murray *TMM* #7
Re: Print Selected Area Button
Fails on Mac/IE5x however.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rilkesf" <webforumsuser@macromedia.com> wrote in message
news:dedman$iue$1@forums.macromedia.com...> If all you want to do is grab a certain part of the page, you could also
> do it
> this way:
>
> Wrap all the content you want printed in a <div> tag and give it an 'id'
> attribute
> Then, put an onClick handler on your 'print-page' link/button and point it
> to
> a javascript function.
>
> Here's the code:
>
> JAVASCRIPT
> // this javascript code opens a new window and fills it with everything
> inside
> the selected <div> tag
>
> function printPage(ID) {
> var winprint = window.open("","printer","");
> var content = document.getElementById(ID).innerHTML;
> winprint.document.open();
> winprint.document.write('<html><head><title>YOUR TITLE
> </title><body>');
> winprint.document.write(content);
> winprint.document.write('</body></html>');
> winprint.document.close();
> winprint.focus();
> }
>
> AND HERE'S THE <html> CODE:
> <body>
> <div id="print_content">
> All the content you want to show up in the new window goes here
> </div>
> </body>
>
> <a href="#" onClick="printPage('ID');">link/button</a>
> where ID matches the id attribute of the <div> .. in this case
> 'print_content'
>
> As a sidenote, the code for the link button does not have to be placed
> outside
> of the <div> tag; it can be anywhere between <body> and </body>
>
Murray *TMM* Guest
-
rilkesf #8
Re: Print Selected Area Button
Works for me on Mac/IE 5.2.
Is there a difference between 5.2 and other 5.x versions? I'm still figuring
out all the quirks between various browsers.
Originally posted by: Newsgroup User
Fails on Mac/IE5x however.
rilkesf Guest
-
Murray *TMM* #9
Re: Print Selected Area Button
Post a link to the page, please. Mac IE5x is incapable of responding to a
programmatic print request on an HTML page, as far as I know. I'd love to
see it work, however....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rilkesf" <webforumsuser@macromedia.com> wrote in message
news:defjob$bd4$1@forums.macromedia.com...> Works for me on Mac/IE 5.2.
>
> Is there a difference between 5.2 and other 5.x versions? I'm still
> figuring
> out all the quirks between various browsers.
>
>
> Originally posted by: Newsgroup User
> Fails on Mac/IE5x however.
>
>
>
>
>
Murray *TMM* Guest
-
rilkesf #10
Re: Print Selected Area Button
I've just been testing it locally, but I threw up a barebones example at:
[url]http://oct.sfsu.edu/test.htm[/url]
As I said, works fine for me in MacIE 5.2. I've checked some other sites that
use the same method though and, as you said, they don't work. Strange indeed!
I must be missing something.
Post a link to the page, please. Mac IE5x is incapable of responding to a
programmatic print request on an HTML page, as far as I know. I'd love to
see it work, however....
rilkesf Guest
-
withhisstripes #11
Re: Print Selected Area Button
Okay, thanks for the input, I think that helps. So the ID tag points to
the file correct? My CSS file with the JS in it is located in the main
directory and is called 'print.css', but I still don't get it to print. Could
you possibly look at my code and see if you can see where I am going wrong?
[url]www.reveration.org/devotional.htm[/url]
Oh, and I figure if anyone is smart enough to use a Mac in the first
place, they'll know better than to use IE. :p
withhisstripes Guest
-
withhisstripes #12
Re: Print Selected Area Button
Actually, I tinkered around a bit and found a few simple typo's, so I got it.
Thanks so much for the help. Now... neither of you know how to get the
submission form on the website to send its message directly to my e-mail
without having to use a third party program would you? :/
withhisstripes Guest
-
Murray *TMM* #13
Re: Print Selected Area Button
> without having to use a third party program would you? :/
Can't be done, except by using the unreliable mailto: method.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"withhisstripes" <webforumsuser@macromedia.com> wrote in message
news:degags$ecq$1@forums.macromedia.com...> Actually, I tinkered around a bit and found a few simple typo's, so I got
> it.
> Thanks so much for the help. Now... neither of you know how to get the
> submission form on the website to send its message directly to my e-mail
> without having to use a third party program would you? :/
>
Murray *TMM* Guest
-
Murray *TMM* #14
Re: Print Selected Area Button
Fails for me in IE5.2.3 (5815.1) OS 10.3.9.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rilkesf" <webforumsuser@macromedia.com> wrote in message
news:defu2f$qf5$1@forums.macromedia.com...> I've just been testing it locally, but I threw up a barebones example at:
>
> [url]http://oct.sfsu.edu/test.htm[/url]
>
> As I said, works fine for me in MacIE 5.2. I've checked some other sites
> that
> use the same method though and, as you said, they don't work. Strange
> indeed!
> I must be missing something.
>
>
> Post a link to the page, please. Mac IE5x is incapable of responding to a
> programmatic print request on an HTML page, as far as I know. I'd love to
> see it work, however....
>
>
>
>
Murray *TMM* Guest
-
Murray *TMM* #15
Re: Print Selected Area Button
There's no link to the print stylesheet in that page.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"withhisstripes" <webforumsuser@macromedia.com> wrote in message
news:deg9u1$dks$1@forums.macromedia.com...> Okay, thanks for the input, I think that helps. So the ID tag points
> to
> the file correct? My CSS file with the JS in it is located in the main
> directory and is called 'print.css', but I still don't get it to print.
> Could
> you possibly look at my code and see if you can see where I am going
> wrong?
> [url]www.reveration.org/devotional.htm[/url]
> Oh, and I figure if anyone is smart enough to use a Mac in the first
> place, they'll know better than to use IE. :p
>
Murray *TMM* Guest



Reply With Quote

