[self.scrollView lockFocus];
NSImage image = [[NSImage alloc] initWithData: [(NSView ) self.scrollView.documentView dataWithPDFInsideRect:bounds]];
[self.scrollView unlockFocus];
if the scrolling view is in the same application, it can be achieved in the above way, but if it is not in the same application, how can I get the NSScrollView object? Whether the corresponding NSView? can be obtained through id