![]() |
Print a different page than current page?
I have an html page describing an event we will be holding, "description.html". I have a Word document (which I can convert to PDF or html format) which is the registration form for the event.
I would like to create a link at the bottom of "description.html" that says, "Click here to print the registration form." I want the viewer to be able to click on the link and have the registration form automatically go to the printer, without having to open it first. I found a javascript that will print a different page than the current page, but only if you go to FILE, PRINT in the browser. I would really like to do it with a link or a button. I was told you can accomplish this with the use of framesets, but I couldn't get it to work right. Can anyone help? |
Re: Print a different page than current page?
u want it to go strait to the printer?
I know that if u put a link on description.html to the form ure placing there as well it will ask u to save or open it. from either or both u can then open and print the page as for making it go straight to the printer i'm not sure maybe IM brandon and maybe he can assist |
Re: Print a different page than current page?
You want this button to automatically send the page to the printer without loading on the screen? As far as I know, that's not possible. And I wouldn't really recommend it if it is. It's nice to see what you're printing before-hand to see what it is, how long it is, etc. I'd either go with a PDF or an HTML file for an online doc. I'm a bit opposed to using the MS Word format on a website since not everyone has Word and the formating of the page is more like to be off than with HTML or a PDF.
|
Re: Print a different page than current page?
I found this at HtmlGoodies.
It doesn't do exactly what you want, but it does show an onload command that might work for you. Quote:
|
Re: Print a different page than current page?
Thanks for your suggestions. I agree about the Word document; we normally do not post docs in that format.
|
Re: Print a different page than current page?
Will this help you at all?
http://www.dynamicdrive.com/dynamici...printstyle.htm |
Re: Print a different page than current page?
I figured out how to do it.
In the current document, in the HEAD tag, type the following code (where href= refers to the different page you want to print without loading to the screen first): <link rel="alternate" media="print" href="different_page.html" /> <script> function printWindow(){ bV = parseInt(navigator.appVersion) if (bV >= 4) window.print() } </script> and then in the BODY of the current document type: <a href="javascript:printWindow()">Print The Different Page</a> (I wanted a link to print and not a print button). I know this won't work for every browser, but it will work for my purposes. Thanks to everyone who replied with suggestions! |
Re: Print a different page than current page?
LOL, OK, I have no idea how to get that smiley face outta the code! But you can figure out what I meant!
|
Re: Print a different page than current page?
Quote:
if you want to add another line in your code you can have it so theres a link to the page you want printed if the browser doesnt support it. it being this: Code:
<link rel="alternate" media="print" href="different_page.html" /> |
Re: Print a different page than current page?
I think that this should work, but I haven't tested it:
|
| All times are GMT -5. The time now is 14:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi