Open Local PDF in Safari in iOS

前端 未结 2 472
轻奢々
轻奢々 2021-01-21 17:24

Let\'s say that myURL pointed to a PDF which was obtained by doing:

myURL = [[NSBundle mainBundle] URLForResource:@\"my\" withExtension:@\"PDF\"];
相关标签:
2条回答
  • 2021-01-21 17:41

    As far as I know it is not possible to hand a local PDF file off to MobileSafari.

    But you can easily hand off a local PDF file to any locally installed application that acts as a PDF viewer. i.e., iBooks, GoodReader, etc. If this is sufficient, you should take a look at UIDocumentInteractionController. It will present a menu of apps, and let the user choose one to open the file in. Unfortunately, Safari itself does not register as a PDF viewer.

    (If you did decide to present PDFs yourself, the QLPreviewController will display the file and give you the "send to other app" functionality.)

    0 讨论(0)
  • 2021-01-21 17:54

    This is not currently possible.

    0 讨论(0)
提交回复
热议问题