Re: IE7 Printing WOImage issues
Chuck Hill <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
On Feb 8, 2008, at 1:01 PM, Brian Lakeman wrote: > I've been banging my head against the wall trying to work around > this issue: > > I've got a WOImage that uses the data attribute bound to an NSData > object > to provide the image, and the mimeType defined accordingly. > > When viewing this in IE7 the image displays fine, if I try to print > the page, the image doesn't show up on the printout. If you right- > click on the image and try to "Save Picture as...", you get "error > 800700de". > > Works fine in other browsers. If the WOImage is bound with the > filename attribute, it prints just fine in IE7. > > I wrote a little app that displays /Library/WebServer/Documents/ > apache_pb.gif twice. One referenced with the filename attribute, > the other one referenced by the data attribute bound to an NSData > object populated by reading that file. One image prints, the other > one doesn't. > > I'm using WO 5.3 running on OS X Tiger. > > I wish I could tell all the users to not use IE7, but that's not an > option. Having seen similar situations, I think I know what is going on here. The problem is that other browsers use the image they have cached when they rendered that page. However IE7 prints, it wants to download it again. That interacts with how the WOResourceManager manages memory: after a resource is requested once, it is discarded. For one way around this, see the WOImage binding "key": A string that the application uses as a key for caching the data specified in data. If you do not provide a key, the data object must be fetched each time it is needed. For further information, see the reference documentation for the WOResourceManager class, particularly that for the flushDataCache method. I think this means that if you give a key, then _you_ are responsible for getting that data (image) out of the cache (e.g. when the page is finalized). You might be able to use a direct action to return the image, it very much depends on your logic surrounding this image. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects