2016-12-09 91 views
2

我正在使用FoxitRDK框架在我的应用程序中打开PDF文档。在演示中,除了一件事情之外,一切正常:我无法点击超链接。我已经通过SDK文档和框架内的类,但无法罚款解决方案。FoxitIOSRDK:无法点击超链接

文档链接低于:

http://www.foxitsdk.com/docs/mobile-pdf-sdk/developer_guide_ios.pdf

,这里是我的代码

NSString* pdfPath = [[NSBundle mainBundle] pathForResource:@"getting_started_ios1" ofType:@"pdf"]; 
// Initialize a PDFDoc object with the path to the PDF file 
FSPDFDoc* pdfdoc = [FSPDFDoc createFromFilePath:pdfPath]; 

// Initialize a FSPDFViewCtrl object with the size of the entire screen 

pdfViewCtrl = [[FSPDFViewCtrl alloc] initWithFrame: CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-60)]; 

[pdfViewCtrl registerDocEventListener:self]; 
[pdfViewCtrl registerPageEventListener:self]; 
[pdfViewCtrl registerGestureEventListener:self]; 


// Set the document to display 
[pdfViewCtrl setDoc:pdfdoc]; 
// Add the pdfViewCtrl to the root view 
[self.view addSubview:pdfViewCtrl]; 
extensionsManager= [[UIExtensionsManager alloc]initWithPDFViewControl:pdfViewCtrl]; 
pdfViewCtrl.extensionsManager = extensionsManager; 

[extensionsManager registerAnnotEventListener:self]; 
[extensionsManager registerAnnotHandler:self]; 


//Search button 

searchButton = [[UIButton alloc] initWithFrame:CGRectMake(280, 80, 80, 40)]; 
[searchButton setBackgroundColor:[UIColor grayColor]]; 
[searchButton setTitle: @"Search" forState: UIControlStateNormal]; 
[searchButton addTarget:self action:@selector(showSearchBar) 
     forControlEvents:UIControlEventTouchUpInside]; 
[self.view addSubview:searchButton]; 

我该如何解决这个问题?

回答

1

感谢Foxit支持团队在将版本更新至2.0之后,它的工作非常完美。

我已经得到了解决方案。 祝你好运团队。

1

您需要将UI扩展组件添加到您的应用程序。 您可以参考开发人员指南中的“2.4.5添加对文本搜索,书签和注释的支持”一节中的步骤。

将UI扩展添加到项目并初始化之后,该链接将工作。

相关的代码在这里:

"#import "../uiextensions/UIExtensionsManager.h" 

UIExtensionsManager* extensionsManager; 

... 

extensionsManager = [[UIExtensionsManager alloc] initWithPDFViewControl:pdfViewCtrl]; 

pdfViewCtrl.extensionsManager = extensionsManager;" 

如果你想转到专门的页面时,打开文档,你需要做的是在onDocOpened事件。

(void)onDocOpened:(FSPDFDoc*)document error:(int)error 
{ 
    [_pdfViewCtrl gotoPage:2 animated:false]; 
} 
+0

我已编辑我的问题.even在演示代码中不起作用 – guru

+0

[pdfViewCtrl gotoPage:3 animated:true];需要在onDocOpened事件中调用。 –

+0

谢谢艾米,但我的问题是不同的相关超链接 – guru