H
headware
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 <img> tag 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 <img> tag
but that can stretch the image and make the text hard to read. I could
also put the <img> tag into a <div> of 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
to print to labels. We decided to do this by creating an <img> tag 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 <img> tag
but that can stretch the image and make the text hard to read. I could
also put the <img> tag into a <div> of 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