Log in

View Full Version : Alternate document for printing



marcel1974
10-04-2006, 11:05 AM
Hello,

I have read the article 'Alternate document for printing' on this site about printing a document by placing the '<link rel=alternate media=print href="printversion.doc">' tag in the head.

But what if you want this document to be printed when a button is clicked? What tag do I use to realise this?

I have a website whit a print-button. When this button is clicked, I want a word-document to be printed directly on the printer.

thx for the replies.

Marcel

BLiZZaRD
10-04-2006, 11:31 AM
in your <head> put:



<link rel=alternate media=print href="printversion.doc">


and in your <body> put:



<input type="Button" name="printit" value="print" onclick="javascript:window.print();">

Twey
10-04-2006, 04:43 PM
This is a very bad idea. It works only on IE, and not even in all cases then.

You should use a printing CSS stylesheet instead.

BLiZZaRD
10-04-2006, 10:23 PM
Beg to differ. I tested it in FF 1.0.7, 1.5.x on Win2k, as well as Windows 98, 2k, and XP with IE 5, 6 and 7

Worked perfect each time :D

Twey
10-05-2006, 07:42 PM
Really? Hm, we have people complaining it doesn't work all the time on here. I notice you only tested it on Windows, though.

djr33
10-06-2006, 02:01 AM
Off topic question-- how are you running all of those operating systems?

BLiZZaRD
10-06-2006, 08:05 AM
Yes, I didn't test on my *nix box because my daughter was using it to chat up her boyfriend.

I run a few OS on a few different machines, and I am fixing a wireless chip problem on a co-workers laptop right now, so I have 7 computers in my house running various this and thats.

Grub dual boot baby :D

djr33
10-06-2006, 09:02 AM
Fun. Ok, back to the topic....