I'm trying to save all of the contents of a UIScrollView to a .pdf. I found some tutorials for saving the current view, and they all rely on creating a CGContextRef using UIGraphicsGetCurrentContext()
. Right now, I capture my view with just
CGContextRef context = UIGraphicsGetCurrentContext();
[myView.layer renderInContext:context];
And that works fine for a plain UIView. However, when I try to pass a UIScrollView as myView
, it passes the visible part of the UIScrollView fine, but anything offscreen is just white space. Is there a way I can expand context
somehow to get all of the content in my UIScrollView, and not just what is currently visible? I suspect that I can't use UIGraphicsGetCurrentContext()
for a UIScrollView, but I don't know what to use instead, and the Apple docs on this aren't really very helpful.