开发者

Hyperlinks not working in PDFView (in my cocoa app)

开发者 https://www.devze.com 2023-03-30 03:03 出处:网络
I have a PDFV开发者_C百科iew object in one of my windows and wondering if there\'s anything special I need to do in order for the hyperlinks to work.

I have a PDFV开发者_C百科iew object in one of my windows and wondering if there's anything special I need to do in order for the hyperlinks to work.

The same pdf files have working hyperlinks when opened in other apps (like skim, preview, etc).

Any ideas?


Add a delegate to your PDFView that responds to this selector

- (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)url
{
   [[NSWorkspace sharedWorkspace] openURL:url];
}


Turned out that I simply had to enable this in my derived class: [super mouseDown:theEvent];

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号