4

I'm displaying locally stored pdf in my iPad application. Here's the code:

NSString *path = [[NSBundle mainBundle] pathForResource:@"About Downloads" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[pdfWebView loadRequest:request];

Now, by default, you can't copy text or images from the PDF which is rendered by the UIWebView. Is there a way to let users copy text and/or images out of pdf?

I'm not familiar with CATitledLayer, so i'm just wondering if it can help in this case?

Mustafa
  • 20,504
  • 42
  • 146
  • 209

2 Answers2

2

There's no simple answer to this. PDF's are nested dictionaries composed of more dictionaries & arrays. You'll have to dig into CGPDFDocument. Voyeur is an excellent tool to use while digging around in PDF's. Reader is a good suggested starting point for rendering PDF's.

shawnwall
  • 4,549
  • 1
  • 27
  • 38
1

To get at the text in a PDF Document, I use PDF Kitten (https://github.com/KurtCode/PDFKitten). It works quite well, but as the author notes, is incomplete and does not support all font types.

listing boat
  • 251
  • 1
  • 4
  • 14