473,497 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pixels per Inch

I have to create some vertical text for a web page that allows users
to print to labels. We decided to do this by creating an <imgtag on
the web page and having the src attribute point to another ASP.NET
page that generates the image on the fly and streams it back to the
browser. It works fine, but I'm worried about sizing issues. The image
has to be a specific height and width to fit properly onto the label.
The constructor for the Drawing.Bitmap class (which is what we're
using to generate the image) takes pixels as arguments, not inches or
any "real" measurements. I don' t think that pixels are absolute
measurements of length are they? I think they differ in size between
platforms and maybe even monitors.

Since it's a web page, we can't rely on any particular browser or
platform. I could set the width and height attributes on the <imgtag
but that can stretch the image and make the text hard to read. I could
also put the <imgtag into a <divof fixed size but that may cut off
parts of the image if it ends up being too big. I'd rather have a way
for the browser to tell the image generating page how many pixels per
inch it can handle. I'm not sure if you can get that kind of data from
the browser, but that would probably work if we could.

Any suggestions would be appreciated.

Thanks,
Dave
Dec 4 '07 #1
3 3121
>I could
>also put the <imgtag into a <divof fixed size but that >may cut off
parts of the image if it ends up being too big.

u could set the img width to be 100% width&height of the div container
using some css


On Dec 4, 8:19 am, headware <david.k.l...@gmail.comwrote:
I have to create some vertical text for a web page that allows users
to print to labels. We decided to do this by creating an <imgtag on
the web page and having the src attribute point to another ASP.NET
page that generates the image on the fly and streams it back to the
browser. It works fine, but I'm worried about sizing issues. The image
has to be a specific height and width to fit properly onto the label.
The constructor for the Drawing.Bitmap class (which is what we're
using to generate the image) takes pixels as arguments, not inches or
any "real" measurements. I don' t think that pixels are absolute
measurements of length are they? I think they differ in size between
platforms and maybe even monitors.

Since it's a web page, we can't rely on any particular browser or
platform. I could set the width and height attributes on the <imgtag
but that can stretch the image and make the text hard to read. I could
also put the <imgtag into a <divof fixed size but that may cut off
parts of the image if it ends up being too big. I'd rather have a way
for the browser to tell the image generating page how many pixels per
inch it can handle. I'm not sure if you can get that kind of data from
the browser, but that would probably work if we could.

Any suggestions would be appreciated.

Thanks,
Dave
Dec 4 '07 #2
you can specify the image size in points (about 72 points/inch) which
will transfer to the printer correctly. the browser will scale it, just
be sure you have enough resolution.

-- bruce (sqlwork.com)
headware wrote:
I have to create some vertical text for a web page that allows users
to print to labels. We decided to do this by creating an <imgtag on
the web page and having the src attribute point to another ASP.NET
page that generates the image on the fly and streams it back to the
browser. It works fine, but I'm worried about sizing issues. The image
has to be a specific height and width to fit properly onto the label.
The constructor for the Drawing.Bitmap class (which is what we're
using to generate the image) takes pixels as arguments, not inches or
any "real" measurements. I don' t think that pixels are absolute
measurements of length are they? I think they differ in size between
platforms and maybe even monitors.

Since it's a web page, we can't rely on any particular browser or
platform. I could set the width and height attributes on the <imgtag
but that can stretch the image and make the text hard to read. I could
also put the <imgtag into a <divof fixed size but that may cut off
parts of the image if it ends up being too big. I'd rather have a way
for the browser to tell the image generating page how many pixels per
inch it can handle. I'm not sure if you can get that kind of data from
the browser, but that would probably work if we could.

Any suggestions would be appreciated.

Thanks,
Dave
Dec 4 '07 #3
On Dec 4, 1:37 am, bruce barker <nos...@nospam.comwrote:
you can specify the image size in points (about 72 points/inch) which
will transfer to the printer correctly. the browser will scale it, just
be sure you have enough resolution.

-- bruce (sqlwork.com)

headware wrote:
I have to create some vertical text for a web page that allows users
to print to labels. We decided to do this by creating an <imgtag on
the web page and having the src attribute point to another ASP.NET
page that generates the image on the fly and streams it back to the
browser. It works fine, but I'm worried about sizing issues. The image
has to be a specific height and width to fit properly onto the label.
The constructor for the Drawing.Bitmap class (which is what we're
using to generate the image) takes pixels as arguments, not inches or
any "real" measurements. I don' t think that pixels are absolute
measurements of length are they? I think they differ in size between
platforms and maybe even monitors.
Since it's a web page, we can't rely on any particular browser or
platform. I could set the width and height attributes on the <imgtag
but that can stretch the image and make the text hard to read. I could
also put the <imgtag into a <divof fixed size but that may cut off
parts of the image if it ends up being too big. I'd rather have a way
for the browser to tell the image generating page how many pixels per
inch it can handle. I'm not sure if you can get that kind of data from
the browser, but that would probably work if we could.
Any suggestions would be appreciated.
Thanks,
Dave
Thanks for the response Bruce. By "point" do you mean pixel? I've read
that the pixels per inch number is not an industry constant. In other
words, 72 pixels does not always equate to 1 inch. I'm pretty confused
about the whole subject and it seems to be hard to find good
information on it. This can't be the first time somebody needed to
print something from a web browser in a precise, reproduceable way.
How do people solve this problem? Is there even a problem to begin
with?
Dec 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8352
by: duikboot | last post by:
Hi there, In Photoshop I can, when I want to change the dpi(dots per inch) of a picture, arrange that the picture won't be resized. Do you know of a way, I can accomplish this in python with...
4
2446
by: nutso fasst | last post by:
window.getComputedStyle() is no good in MSIE. Is there a way to determine the pixel size of the default (or user-specified) font for BODY in IE? Thanks, nf
1
6366
by: cefrancke | last post by:
I've been working with the Twips/Pixel issue and after reviewing the Acc.Dev.Hnd book and the groups, the standard seems to be ... 640x480 15 Twips/Pixel 800x600 12 Twips/Pixel 1024x768 12...
6
2972
by: Craig Parsons | last post by:
Folks, I have an image of a circle, which I am trying to straighten out into a flat line. I am essentially wanting to look at the image, and read a straight line from the centre, and then plot...
13
23211
by: T.Jackson | last post by:
Hi guys, Does anyone know the conversions for the above (relationship between each of the above). Ie how many points makeup a pixel & how many pixels make up a point. -- Besty Regards, TJ
8
2320
by: Rainer Queck | last post by:
Hi NG, in a dataset.datatable I have rows, containing metric data as doubles. I need to display/edit these values in textboxes depending on the culture (Metric/Inch). Is there something like a...
4
1889
by: Jimmy | last post by:
hi, all I attempt to use the function inch() to get the character at the current position, and compare it with a particular character like : if screen.inch(x,y) == 'F' but this method doesn't...
1
4179
by: Nitzan Tomer | last post by:
hi everyone, i created a script that outputs an image (transparent with text) based on parameters passed by $_GET. everything in my application works with 'pixels' and since GD2 this function...
4
2189
by: MangroveRoot | last post by:
A few years ago, I worked on a project in which I designed some tables, queries, forms, and reports. I'm reasonably certain that when I was designing the forms for that project, I set the...
0
7121
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
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7197
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...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
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
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.