Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Mon, 25 Aug 2008 09:36:02 -0700,    group: microsoft.public.inetsdk.programming.webbrowser_ctl        back       


How to Scroll without cropping visibility of elements ??   
VB6
I'm using the web browser control,
and I'm also using the MSHTML DOM to control the window.
For example, I'm scrolling like this:
Document.parentWindow.scrollTo

However, since the scroll is pixel-based, I frequently see that text and 
other elements are cropped. Sometimes, lines of text are only half visible at 
the bottom of the window.

I am grabbing screenshots of the Wbe browser window, so I'd like to 
eliminate the cropping.

Is it possible to scroll and be sure that elements are not cropped ?

For example, if I print an html page to PDF using Acrobat, it never crops a 
line of text.
How can I also do this?

Thanks.
date: Mon, 25 Aug 2008 09:36:02 -0700   author:   WHoit

Re: How to Scroll without cropping visibility of elements ??   
WHoit  wrote:
> However, since the scroll is pixel-based, I frequently see that text
> and other elements are cropped. Sometimes, lines of text are only
> half visible at the bottom of the window.
>
> Is it possible to scroll and be sure that elements are not cropped ?

In general, this is physically impossible. If the height of the client 
area is not the exact multiple of the height of a line of text (ignoring 
for the moment things like images that could make the latter uneven), 
then you'll necessarily have partial lines either at the top or at the 
bottom (or both).
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 25 Aug 2008 12:52:54 -0400   author:   Igor Tandetnik

Re: How to Scroll without cropping visibility of elements ??   
So, when I print the same web browser to a PDF using Acrobat, how does 
Acrobat ensure that:
1) There are no horizontally cropped lines and
2) The page size is what I requested when printing ?

"Igor Tandetnik" wrote:

> WHoit  wrote:
> > However, since the scroll is pixel-based, I frequently see that text
> > and other elements are cropped. Sometimes, lines of text are only
> > half visible at the bottom of the window.
> >
> > Is it possible to scroll and be sure that elements are not cropped ?
> 
> In general, this is physically impossible. If the height of the client 
> area is not the exact multiple of the height of a line of text (ignoring 
> for the moment things like images that could make the latter uneven), 
> then you'll necessarily have partial lines either at the top or at the 
> bottom (or both).
> -- 
> With best wishes,
>     Igor Tandetnik
> 
> With sufficient thrust, pigs fly just fine. However, this is not 
> necessarily a good idea. It is hard to be sure where they are going to 
> land, and it could be dangerous sitting under them as they fly 
> overhead. -- RFC 1925
> 
> 
>
date: Mon, 25 Aug 2008 10:06:02 -0700   author:   WHoit

Re: How to Scroll without cropping visibility of elements ??   
WHoit  wrote:
> So, when I print the same web browser to a PDF using Acrobat, how does
> Acrobat ensure that:
> 1) There are no horizontally cropped lines and
> 2) The page size is what I requested when printing ?

It's not Acrobat that's doing this, but the browser itself. You would 
get the same results if you print to paper on a physical printer. The 
printer driver (whether Acrobat or physical printer) tells the browser 
what the dimensions of the page are, and the browser lays out HTML so it 
fits on the page.

You, on the other hand, are dealing with HTML laid out for the screen, 
which the browser essentially treats as one infinitely long page.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 25 Aug 2008 13:21:58 -0400   author:   Igor Tandetnik

Re: How to Scroll without cropping visibility of elements ??   
So, then is it possible to tell the browser to lay out the HTML for a printer,
but display it on scrren so I can grab it?

"Igor Tandetnik" wrote:

> WHoit  wrote:
> > So, when I print the same web browser to a PDF using Acrobat, how does
> > Acrobat ensure that:
> > 1) There are no horizontally cropped lines and
> > 2) The page size is what I requested when printing ?
> 
> It's not Acrobat that's doing this, but the browser itself. You would 
> get the same results if you print to paper on a physical printer. The 
> printer driver (whether Acrobat or physical printer) tells the browser 
> what the dimensions of the page are, and the browser lays out HTML so it 
> fits on the page.
> 
> You, on the other hand, are dealing with HTML laid out for the screen, 
> which the browser essentially treats as one infinitely long page.
> -- 
> With best wishes,
>     Igor Tandetnik
> 
> With sufficient thrust, pigs fly just fine. However, this is not 
> necessarily a good idea. It is hard to be sure where they are going to 
> land, and it could be dangerous sitting under them as they fly 
> overhead. -- RFC 1925
> 
> 
>
date: Mon, 25 Aug 2008 10:36:02 -0700   author:   WHoit

Re: How to Scroll without cropping visibility of elements ??   
WHoit  wrote:
> So, then is it possible to tell the browser to lay out the HTML for a
> printer, but display it on scrren so I can grab it?

There's Print Preview, but I don't know how or whether one can drive it 
programmatically.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 25 Aug 2008 13:44:25 -0400   author:   Igor Tandetnik

Re: How to Scroll without cropping visibility of elements ??   
I'll see what I can find - Thanks.

"Igor Tandetnik" wrote:

> WHoit  wrote:
> > So, then is it possible to tell the browser to lay out the HTML for a
> > printer, but display it on scrren so I can grab it?
> 
> There's Print Preview, but I don't know how or whether one can drive it 
> programmatically.
> -- 
> With best wishes,
>     Igor Tandetnik
> 
> With sufficient thrust, pigs fly just fine. However, this is not 
> necessarily a good idea. It is hard to be sure where they are going to 
> land, and it could be dangerous sitting under them as they fly 
> overhead. -- RFC 1925
> 
> 
>
date: Mon, 25 Aug 2008 10:56:04 -0700   author:   WHoit

Re: How to Scroll without cropping visibility of elements ??   
Igor Tandetnik  wrote:
> WHoit  wrote:
>> So, then is it possible to tell the browser to lay out the HTML for a
>> printer, but display it on scrren so I can grab it?
>
> There's Print Preview, but I don't know how or whether one can drive
> it programmatically.

Also, you'll have problems with screen resolution being too low. Your 
whole screen is probably something around 1280x1024 pixels, whereas a 
typical modern printer would print 600x600 dots per inch.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 25 Aug 2008 13:59:38 -0400   author:   Igor Tandetnik

Re: How to Scroll without cropping visibility of elements ??   
Well, actually, I'm using CreateEnhMetaFile and OleDraw to create an EMF.
So I don't take a screenshot - I 'draw' the window into an EMF. (I only said 
screenshot in my original post, 'cause as soon as I mention EMF, no one 
replies)

:)

"Igor Tandetnik" wrote:

> Igor Tandetnik  wrote:
> > WHoit  wrote:
> >> So, then is it possible to tell the browser to lay out the HTML for a
> >> printer, but display it on scrren so I can grab it?
> >
> > There's Print Preview, but I don't know how or whether one can drive
> > it programmatically.
> 
> Also, you'll have problems with screen resolution being too low. Your 
> whole screen is probably something around 1280x1024 pixels, whereas a 
> typical modern printer would print 600x600 dots per inch.
> -- 
> With best wishes,
>     Igor Tandetnik
> 
> With sufficient thrust, pigs fly just fine. However, this is not 
> necessarily a good idea. It is hard to be sure where they are going to 
> land, and it could be dangerous sitting under them as they fly 
> overhead. -- RFC 1925
> 
> 
>
date: Mon, 25 Aug 2008 11:20:16 -0700   author:   WHoit

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us