I need to display pdf documents within my iPad app, I've seen people suggesting loading it within a webview.
I want to know if this is the best\recommended way to display a pdf?
I need to display pdf documents within my iPad app, I've seen people suggesting loading it within a webview.
I want to know if this is the best\recommended way to display a pdf?
Using a QuickLook.framework
you can easly load pdf and disply i just add following easy step for load pdf using QuickLook.framework
QuickLook.framework
and import in to your class and set it's DataSource in to .h class <QLPreviewControllerDataSource>
Use following method:
-(NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller
{
return 1;
}
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
return [NSURL fileURLWithPath:self.pdfFilePath]; // here is self.pdfFilePath its a path of you pdf
}
and for load set Button Action:
-(IBAction)LoadPdf
{
QLPreviewController* preview = [[[QLPreviewController alloc] init] autorelease];
preview.dataSource = self;
[self presentModalViewController:preview animated:YES];
}
Two easiest way to that
UIWebView
QLPreviewController