title: Import PDF into own App with iOS Action Extension
body: <p>I'm looking for a possibility to import a PDF in order to do some further tasks with it, just like described in this Question: <a href="https://stackoverflow.com/questions/35881269/importing-pdf-files-to-app">Importing PDF files to app</a></p>
  
  <p>After two days of looking around in the inter webs I found that an action extension might be the solution, this is how far I got:</p>
  
  <pre><code>   override func viewDidLoad() {
          super.viewDidLoad()
  
          let fileItem = self.extensionContext!.inputItems.first as! NSExtensionItem
  
          let textItemProvider = fileItem.attachments!.first as! NSItemProvider
  
          let identifier = kUTTypePDF as String
  
          if textItemProvider.hasItemConformingToTypeIdentifier(identifier) {
  
              textItemProvider.loadItemForTypeIdentifier(identifier, options: nil, completionHandler: handleCompletion)
          }
      }
  
      func handleCompletion(pdfFile: NSSecureCoding?, error: NSError!) {
  
          print("PDF loaded - What to do now?")
      }
  </code></pre>
  
  <p>The completion handler is called properly so I assume the PDF is loaded - but then I don't now how to proceed. If the action extension only handles images or text it could easily be downcasted, but the only way to work with files I know is with path names - which I do not have and don't know how to obtain. Plus, I'm pretty sure Sandboxing is also part of the party.</p>
  
  <p>I guess I only need a push in the right direction which Class or Protocol could be suitable for my need - any suggestions highly appreciated. </p>