473,228 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,228 software developers and data experts.

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 2144
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
48
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html ...
9
by: Les Juby | last post by:
I understand that there are several ways to effectively control the browser delivery of HTML to make the most effective use of the different screen resolutions today. (And in the foreseeable...
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
35
by: Friendly_Lola | last post by:
What Screen Resolution do You use? 800 X 600 1024 X 768 1280 X 1024 Wow! 1600 X 1200 (i can't imagine this) I use 1024 X 768. For what resolution you optimize your web pages?
31
by: melinama | last post by:
Hello, I've looked through alt.html and this group for an answer to my question. However, I found only cranky arguments with, occasionally, bits of hard-to-understand code - out of context -...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
1
by: Greoasy | last post by:
I have an asp.net webapplication,designed in laptops having resolution 0f 1280x800. Now the same application when i run on a Desktop with a different resolution the display of the screen is...
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.