Discussion:
Printing after client-side font change
(too old to reply)
VS
2004-03-01 15:57:52 UTC
Permalink
Hello,
I have a page that allows users to change the font family and size for the
contents of the page.
ie. There are 2 dropdowns, one for each change. The user selected size 20
and everything in the page is changed to size 20 by vbscript.
The problem is.. when the user prints the page, it prints the original font
size and family.
Is there a way around this?

Thanks,
V
Bob Barrows [MVP]
2004-03-01 18:33:36 UTC
Permalink
Post by VS
Hello,
I have a page that allows users to change the font family and size
for the contents of the page.
ie. There are 2 dropdowns, one for each change. The user selected
size 20 and everything in the page is changed to size 20 by vbscript.
The problem is.. when the user prints the page, it prints the
original font size and family.
Is there a way around this?
Thanks,
V
Use the onbeforeprint event to set the sizes to a printable size, saving the
current sizes in a global array or something. Then in the onafterprint
event, set them back to the user-settings.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
VS
2004-03-01 19:00:50 UTC
Permalink
Thank you.
What I'm not understanding is.... why do the font size not transfer to
print?
I'm calling a function for an onchange event on the select drop down that
does this:
document.styleSheets(0).addRule "BODY","font-size:" &
window.event.srcElement.value
document.styleSheets(0).addRule "TD","font-size:" &
window.event.srcElement.value

where value is 8px, 9px, 10px, etc...
It's changing the font size they see on the screen, but it doesn't print
that way.

Vicky
Post by Bob Barrows [MVP]
Post by VS
Hello,
I have a page that allows users to change the font family and size
for the contents of the page.
ie. There are 2 dropdowns, one for each change. The user selected
size 20 and everything in the page is changed to size 20 by vbscript.
The problem is.. when the user prints the page, it prints the
original font size and family.
Is there a way around this?
Thanks,
V
Use the onbeforeprint event to set the sizes to a printable size, saving the
current sizes in a global array or something. Then in the onafterprint
event, set them back to the user-settings.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
VS
2004-03-02 17:34:39 UTC
Permalink
Hello again,
I tried setting the font-sizes in the onbeforeprint event... msgboxing the
style.fontzie clearly shows the correct setting. But it's still printing the
originally loaded size..
help?

Thanks,
V
Post by Bob Barrows [MVP]
Post by VS
Hello,
I have a page that allows users to change the font family and size
for the contents of the page.
ie. There are 2 dropdowns, one for each change. The user selected
size 20 and everything in the page is changed to size 20 by vbscript.
The problem is.. when the user prints the page, it prints the
original font size and family.
Is there a way around this?
Thanks,
V
Use the onbeforeprint event to set the sizes to a printable size, saving the
current sizes in a global array or something. Then in the onafterprint
event, set them back to the user-settings.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Loading...