Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Pixels per Inch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
headware - 04 Dec 2007 00:19 GMT
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
Nick Chan - 04 Dec 2007 02:03 GMT
>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.

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

> 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
[quoted text clipped - 21 lines]
> Thanks,
> Dave
bruce barker - 04 Dec 2007 06:37 GMT
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)

> 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
[quoted text clipped - 21 lines]
> Thanks,
> Dave
headware - 04 Dec 2007 20:20 GMT
> 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
[quoted text clipped - 27 lines]
> > 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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.