aspose file tools*
The moose likes Servlets and the fly likes How to set size of servlet generated image to match size of browser window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to set size of servlet generated image to match size of browser window" Watch "How to set size of servlet generated image to match size of browser window" New topic
Author

How to set size of servlet generated image to match size of browser window

Barron Greig
Greenhorn

Joined: Jan 26, 2002
Posts: 8
Hello all,
I have a servlet that generates JPEG with hardcoded dimensions. What I'd really like though is to somehow pass details of the browser window width and height to the servlet so that it generates an image exactly that size. Also, if the user resized the window, then I'd send back a new image with the correct dimensions.
Any ideas how I'd do this?
Thanks in advance,
Barry
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12781
    
    5
I think you would have to use JavaScript to get the screen height and width and incorporate that information in the URL for the image. Looking at this JavaScript Pocket Reference I just got, that looks like screen.availHeight and screen.availWidth (but it has been some time since I wrote any Javascript)
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set size of servlet generated image to match size of browser window