473,406 Members | 2,710 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,406 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 2149
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.