Reputation: 2817
I am using FoxitRDK framework for opening the pdf document in my App. In the demo everything works fine apart from one thing: I am not able to click on hyperlink. I have go through the SDK document and the classes inside framework but can not able to fine the solution.
The document link is below:
http://www.foxitsdk.com/docs/mobile-pdf-sdk/developer_guide_ios.pdf
and here is my code
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];
How can I fix this?
Upvotes: 2
Views: 154
Reputation: 2817
Thanks Foxit support team after updating the version to 2.0 it works perfect.
I have got the solution. Good luck Team.
Upvotes: 1
Reputation: 1
You need to added UI extensions component to your app. you can refer to the step in section"2.4.5 Add support for Text Search, Bookmark, and Annotation" of the developer guide.
After added the UI extensions to you project, and Initialize it, the link will be work.
related code are here:
"#import "../uiextensions/UIExtensionsManager.h"
UIExtensionsManager* extensionsManager;
...
extensionsManager = [[UIExtensionsManager alloc] initWithPDFViewControl:pdfViewCtrl];
pdfViewCtrl.extensionsManager = extensionsManager;"
If you want to Goto special page when a document open, you need to do it in the onDocOpened event.
(void)onDocOpened:(FSPDFDoc*)document error:(int)error
{
[_pdfViewCtrl gotoPage:2 animated:false];
}
Upvotes: 1