I used - (BOOL)presentPreviewAnimated:(BOOL)animated; to load the doc, then I want to take the screenshot from the doc.So I try
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
currentImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
but it just take the mainview, so I am looking for someone could tell me how to take the doc view’s layer.
That will not work because popovers (There is one that contains the UIDocumentInteractionController) are not added to your view controller’s view.
They are added to their own view that is on top of your application window.
If you use
uiDimmingViewyou will get the entire view that contains the popover.uiPopoverViewis the popover itself.These results are not optimal but probably is enough for non-production things (I am assuming you want this for showing it to someone else, etc).