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 / February 2008

Tip: Looking for answers? Try searching our database.

getting height of a block of text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 12 Feb 2008 04:58 GMT
I am converting an MS Access app that I wrote sevearl years ago for a client
over to ASP. There's a feature in the app that I am not sure how to do in
ASP and need some input on.

They need to know the height in inches of a block of text formatted a
certain way for determining layout in a newspaper. The block of text will
vary in content and lenght from record to record so here's what I did in
Access: I open up an invisible instance of MS Word on the client machine,
set the margins, font, etc., paste the text in and using some unusal word
doc properties I can figure out the height in inches. It's worked well for
quite some time.

I know from some of my recent research that it's a bad idea to try to
automate Word on the server for many clients. Everyone says it's a big mess
to deal with and Microsoft advises against it. So I'm tryign to figure out
the best way to handle this. It occurred to me taht I could put a hidden
table (1 row by 1 column) on a page, set the width, font, etc, in design and
then in code, paste the text in. I noticed that the cell stretches in height
to fit the text. Seems like I could get the hieght after all that occurs.
I'm worndering if this is a good solution or not and if not, what other
solutions might be sensible.

Any help would be greatly appreciated.

Thanks,

Keith
Michael Nemtsev [MVP] - 12 Feb 2008 10:54 GMT
Hello Keith,

What happens if the user change the font size in browser?

I think that using the Silverlight in your case will be the best solution,
because there you have all necessary instuments to meausure you fonts and
create the right layout height

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

KH> I am converting an MS Access app that I wrote sevearl years ago for
KH> a client over to ASP. There's a feature in the app that I am not
KH> sure how to do in ASP and need some input on.
KH>
KH> They need to know the height in inches of a block of text formatted
KH> a certain way for determining layout in a newspaper. The block of
KH> text will vary in content and lenght from record to record so here's
KH> what I did in Access: I open up an invisible instance of MS Word on
KH> the client machine, set the margins, font, etc., paste the text in
KH> and using some unusal word doc properties I can figure out the
KH> height in inches. It's worked well for quite some time.
KH>
KH> I know from some of my recent research that it's a bad idea to try
KH> to automate Word on the server for many clients. Everyone says it's
KH> a big mess to deal with and Microsoft advises against it. So I'm
KH> tryign to figure out the best way to handle this. It occurred to me
KH> taht I could put a hidden table (1 row by 1 column) on a page, set
KH> the width, font, etc, in design and then in code, paste the text in.
KH> I noticed that the cell stretches in height to fit the text. Seems
KH> like I could get the hieght after all that occurs. I'm worndering if
KH> this is a good solution or not and if not, what other solutions
KH> might be sensible.
KH>
KH> Any help would be greatly appreciated.
KH>
KH> Thanks,
KH>
KH> Keith
KH>
Keith G Hicks - 12 Feb 2008 14:40 GMT
> Hello Keith,
>
> What happens if the user change the font size in browser?

We considered that but figured there would be a way around it. All of this
is very new to me so I'm kind of fishing around for what to do here. Not
sure at all what the options are.

> I think that using the Silverlight in your case will be the best solution,
> because there you have all necessary instuments to meausure you fonts and
> create the right layout height

I've never heard of Silverlight. I looked it up and found some references
but they all seem very vague as is usually the case with something new. I
found nothing that clearly explains what it is. This quote is from the MS
site:

MicrosoftR SilverlightT is a cross-browser, cross-platform plug-in for
delivering the next generation of media experiences and rich interactive
applications for the Web.

That sentence means nothing whatsoever. It's just PR fluff.

So what is Silverlight? Is it a new browser from MS? Is it a box of tools?
???

I am very new to all of this (asp, web development, etc) so I'm hoping
someone out there can point me to some good clear detailed information on
what to do.

> ---
> WBR,
[quoted text clipped - 32 lines]
> KH> Keith
> KH>

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.