|
-
February 6th, 2008, 08:46 AM
#1
Webbrowser scale and print content
Hi. In my application, I have a WebBrowser in which I load a webpage. This works fine, but now I want to scale the page (if the content is larger then my control) and then print the page (scaled, so that it fits to exactly one page).
You can open the PrintDialog, but I want to do all this without user-interaction. Any ideas about that?
Last edited by martho; February 6th, 2008 at 08:51 AM.
-
February 7th, 2008, 12:41 PM
#2
Re: Webbrowser scale and print content
Are you generating the HTML that is shown in the browser control?
The job of the browser control is to display your HTML. If your HTML is wrapped in tables with fixed width <table width="600"> then its not going to scale. Using <table width="100%"> will scale to the size of the control.
Images work the same way...
Or perhaps you are trying to show a preview type display of the webpage?
This may help: http://code.google.com/p/csexwb2/
-
February 7th, 2008, 01:48 PM
#3
Re: Webbrowser scale and print content
Thanks for your reply. What I need is more like the zoom you find in IE7 at the right bottom, but done programmatically. This scales even images and pixel-layouts.
Is this possible with the tool you mentioned?
-
February 13th, 2008, 11:37 AM
#4
Re: Webbrowser scale and print content
Cant you override the paint function of the web browser and use matrices to zoom?
Please vote the posts you find usefull.
---
I'm back
Bigger and badder
Better and bolder
Explaining stuff -
With an improved vocabulary!
-
October 2nd, 2011, 09:00 AM
#5
Re: Webbrowser scale and print content
I too have been trying to scale the WebBrowser display.
I am still trying to work out the values, but the following will change the scale.
I can only get this to display at one biger size.
WebBrowserControl is the name of my WebBrowser control
Code:
Dim pvaIn As Variant
Dim pvaOut As Variant
pvaIn = Null
pvaOut = Null
Call WebBrowserControl.ExecWB(OLECMDID_OPTICAL_GETZOOMRANGE, OLECMDEXECOPT_DODEFAULT, pvaIn, pvaOut)
'Call WebBrowserControl.ExecWB(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DODEFAULT, pvaIn, pvaOut)
MsgBox "pvaIn= " & pvaIn & vbCrLf + "pvaOut= " & pvaOut, , 1
pvaIn = pvaOut '* 1
pvaIn = 65536010
Call WebBrowserControl.ExecWB(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DODEFAULT, pvaIn, pvaOut)
MsgBox "pvaIn= " & pvaIn & vbCrLf + "pvaOut= " & pvaOut, , 2
Don't spend too much time on your computer.
Sit on a chair instead!!
It's a lot more comfortable and better for your hardware.
:-/ 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|