2

I have actually created my own PDF reader, however, I used a UIWebView and while it does load server side PDF's and does the job of getting them on the screen, I just don't think its the best interface for reading, and interacting with PDF's. For example, here is a sample of my PDF readers "copy" mechanism through the UIWebView:

enter image description here

It seems more for web usage then reading as it has the "Define" mechanism and the motion for expanding the highlighting isn't fluid at all. Now here is an example of the dropbox iOS app PDF reader interface:

enter image description here

as you can see it doesn't have the "Define" mechanism, and the highlighting mechanism is much more fluid. One more difference is the content formatting. The same PDF in my UI looks like its off the Web, as the pages are different sizes:

enter image description here

And in their UI, Its formatted evenly and looks like its meant for reading:

enter image description here

So taking all this in consideration, I guess my question is, did they use a UIWebView to create this interface or a regular UIView? and what should I do to my UI to make it similar to that of dropbox's PDF reader?

Any suggestions are appreciated. Thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
John Jackson
  • 900
  • 2
  • 12
  • 28

1 Answers1

7

The Dropbox app for iOS is using the commercial PSPDFKit PDF SDK, which is available for iOS and Android. I know this because we worked with them and helped them integrate our SDK into their product.

PSPDFKit is not based on UIWebView but completely built ourselves from the ground up with our own rendering engine and view hierarchy. We’ve been working on this for the last 4 years and are about to release another major version.

Text selection is especially tricky since you need to find a way to calculate all glyph coordinates, then approximate where words, lines and text blocks are based on the individual glyph coordinates. The PDF standard was really meant for printing, so extracting flow text and making things selectable requires considerable effort.

Douglas Hill
  • 1,537
  • 10
  • 14
steipete
  • 7,581
  • 5
  • 47
  • 81