Open pdf file in my app via iOS 'open with' functionality


I’m trying to share a pdf e.g. from a email in order to open it in my app.
My app appears in the iOS ‘open with’-menu and after share a doc, the app opens correctly. How do I handle the file or open it in order to get the text content of the pdf in my app? Thank you for your hints!