(from cefPython v0.51_32bit, modification of cefadvanced)
I modified SaveImage() to take an optional width and height.
I get the content size from Jquery, and pass it along to the function.
I run Browser.SetSize() before Browser.GetImage()
- Seems fine, but not able to paint the off-screen content the 1st time around.
I tried adding Browser.Reload() and even Time.sleep() just in case the content hasn't loaded since I ran Browser.SetSize(). I think there is some sort of buffer refresh that's needed, but not what.
Notes:
- This method only works if you only have a vertical scroll bar. If you have both scroll bars, it doesn't render the off-screen content corectly.
- if you run Browser.SetSize() at a size that does not include your scroll bar, you must run it again to re-include your scroll bar, or else it will be disabled until you resize your window.
import time
time.sleep(5)
Set the size of the specified element. This method is only
used when window rendering is disabled. This function is
asynchronous, after a call to SetSize() the
RenderHandler.OnPaint() event might still have the old size,
you would have to ignore it and wait for the next one
RenderHandler.OnPaint() event.
The 2 step idea seems to work. Needs some work to be more straight forward and cleaner, but this does work.
http://mediabakers.com/files/test_code_off-screen_content-fixed.txt