You can do it using drawViewHierarchyInRect: none of the other methods seem to work, use it like so:
UIGraphicsBeginImageContextWithOptions(newRect.size, YES, 0);
BOOL ok = [view drawViewHierarchyInRect:newRect afterScreenUpdates:YES];
if (!ok) {
NSLog(@"Problem with drawView...");
}
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
I'm doing the same in iOS, but unfortunately this method is slow, must also be run in the main thread and only works if afterScreenUpdates is set to yes. See this answer : How can I take a snapshot of a UIView that isn't rendered?
Also there's no way to tell, from what I can see, if any aspect of the webpage needs redrawing.