469,314 Members | 2,239 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,314 developers. It's quick & easy.

Screen Size - Resolution - Mystery Print Preview

SJ
Hi All,

I am trying to write a preview page that will show a red box around
the portion of the screen that would print on a normal 8.5x11 paper.

The problem is setting the width of the div based on the different
resolutions. Does anyone know a formal that will provide the number
of pixels per inch based on the resolution.

Something like:

Div width = resoultion_ration * num_of_inches.

Any ideason how to do this or ant example web pages?

Thanks in advance for your help!

-SJ

Jul 26 '07 #1
3 2057
SJ said the following on 7/26/2007 4:39 PM:
Hi All,

I am trying to write a preview page that will show a red box around
the portion of the screen that would print on a normal 8.5x11 paper.
Print Preview in IE does that for me.
The problem is setting the width of the div based on the different
resolutions. Does anyone know a formal that will provide the number
of pixels per inch based on the resolution.
It isn't that simple. You would have to know the size of my monitor as
well. 1024 x 768 resolution is physically a different size on my laptop
(17") and my desktop (22"). And you have no way, with JS, of determining
my monitor size.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 26 '07 #2
On Jul 26, 4:39 pm, SJ <sjour...@gmail.comwrote:
Hi All,

I am trying to write a preview page that will show a red box around
the portion of the screen that would print on a normal 8.5x11 paper.

The problem is setting the width of the div based on the different
resolutions. Does anyone know a formal that will provide the number
of pixels per inch based on the resolution.

Something like:

Div width = resoultion_ration * num_of_inches.

Any ideason how to do this or ant example web pages?
Leave print preview to the browsers. Trying to simulate it in JS is
impossible.

Jul 26 '07 #3
SJ
On Jul 26, 4:50 pm, David Mark <dmark.cins...@gmail.comwrote:
On Jul 26, 4:39 pm, SJ <sjour...@gmail.comwrote:Hi All,
I am trying to write a preview page that will show a red box around
the portion of the screen that would print on a normal 8.5x11 paper.
The problem is setting the width of the div based on the different
resolutions. Does anyone know a formal that will provide the number
of pixels per inch based on the resolution.
Something like:
Div width = resoultion_ration * num_of_inches.
Any ideason how to do this or ant example web pages?

Leave print preview to the browsers. Trying to simulate it in JS is
impossible.
thanks for the responses!

Jul 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Geoff Cox | last post: by
48 posts views Thread by David J Patrick | last post: by
9 posts views Thread by Les Juby | last post: by
5 posts views Thread by Maxi | last post: by
35 posts views Thread by Friendly_Lola | last post: by
2 posts views Thread by Brad Pears | last post: by
1 post views Thread by Greoasy | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.