I’m trying to find a way to have a “printer friendly” link or button that will switch to an alternate style sheet so that then if the user goes file > print it will print with the alternate style sheet. But at the same time keeping it so if the user goes file > print without clicking “printer friendly” it will print with the default style or print the page “as is”.
I tried using this example:
http://www.alistapart.com/articles/alternate/
But it seems that in IE when you switch to an alternate style sheet and try to print, it prints with no style.
In this example you have a style with media=print so the user can never print the page “as is”. If you don’t use a print=media style is there a way to print with an alternate style sheet in IE?
Copy & paste the code below to embed this comment.
Tom Panton
I think this example would be fine if the preview opened up in a new window and included an actual print button rather than automatically launching the print dialog. This behavior would mimic the actual user process of printing a page with an initial preview. This is what typical users want and expect.
I’ve been trying to figure out how to make this example work in this fashion, but I’m not super proficient in JS. Does anybody have any suggestions?
32 Reader Comments
Back to the ArticleJeff Metter
I’m trying to find a way to have a “printer friendly” link or button that will switch to an alternate style sheet so that then if the user goes file > print it will print with the alternate style sheet. But at the same time keeping it so if the user goes file > print without clicking “printer friendly” it will print with the default style or print the page “as is”.
I tried using this example:
http://www.alistapart.com/articles/alternate/
But it seems that in IE when you switch to an alternate style sheet and try to print, it prints with no style.
In this example you have a style with media=print so the user can never print the page “as is”. If you don’t use a print=media style is there a way to print with an alternate style sheet in IE?
Tom Panton
I think this example would be fine if the preview opened up in a new window and included an actual print button rather than automatically launching the print dialog. This behavior would mimic the actual user process of printing a page with an initial preview. This is what typical users want and expect.
I’ve been trying to figure out how to make this example work in this fashion, but I’m not super proficient in JS. Does anybody have any suggestions?