How to let a user access PDF files created by an application so that they can print them - ios

Okay, so I have an app that generates reports for a Chiropractic clinic and allows the user to print them directly from iPad assuming they have an Airprint printer. I also am in the process of writing code that will allow the user to generate a PDF of the report so that they can email it/upload it to the cloud or somehow send it to some other device that will allow them to print it WITHOUT using AirPrint.
I know about sandboxing, but I also know that you can store PDFs on an iPad and view them through iBooks.
I read here: Loading PDFs into iBooks programmatically that there wasn't a way to do so back in 2010. The guy said he would update his answer, but you know how these things are
I also have a backdoor solution here: Xcode save a PDF as Image? turning the whole darn thing into a .png
Are there any other ways?

Use UIDocumentInteractionController to present a set of options to the user. Let the user choose what they want to do with the PDF.

Related

Manipulate PDF iOS (add signature)

I'm trying to find the best solution for my problem. User is using safari on an iPad, and at one point the customer contract is created using a webservice, which sends me the URL to a PDF file.
Right now the user opens the PDF, prints it and scans it after the customer signs the contract. What they want is to capture the signature digitally, so the contract doesn't need to be scanned later.
My question is: what is the best way to embed the signature to an existing pdf file?
I wanted something similar to what the iOS mail app does natively
http://heresthethingblog.com/2015/10/28/ios-9-tip-sign-pdf-mail-pdf-tricks/
Thanks

Saving files from an iOS app extension to the containing app

I'm working on adding the ability to use the share button to allow users to save files for use with my main application. Multiple file types (image, video, audio, pdf, etc) need to be supported.
A general use case would be:
The user takes a picture with the standard Camera app or audio recording using the Voice Memos app.
User clicks the Share button and selects my extension from the share list.
Dialog opens up giving the user to opportunity to give a description for the file.
File is saved to where my main app (the containing app) can later access and process it.
I've been able to get to the point where I am prompted to share the file, but I have not been able to find a location to successfully save to that my main app can later read from. Is this even possible? Is there a better way to handle this scenario?
I am currently doing this using Xamarin so debugging is not supported (and logging is minimal). If someone has an answer in Objective C, that would at least help point me in the right direction.
There are a few things that you need to do.
First, your app and your app extension should belong to the same app group:
https://developer.apple.com/library/prerelease/ios/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19
Then you can access the shared storage with something like this:
var groupUrl = NSFileManager.DefaultManager.GetContainerUrl ("stackoverflow.com.mygroup")
Now you can access files in the directory pointed by groupUrl.
Xamarin's guide to creating Share extensions for iOS: http://developer.xamarin.com/guides/ios/platform_features/introduction_to_extensions/

iOS, accessing files saved on iPad

I am creating an app where it is a requirement to save a pdf with some info the user has put in, so the user can later on retreive this PDF and save it locally outside of the iPad.
The problem is that I cant figure out where the user will be able to find the saved PDF once it is connected to either a PC or a Mac. When running on the emulator I am able to see the PDF fine, but not when working on an actual device - so this basicly means that clearly the PDF is being saved correctly but it just wont show up in explore/itunes/whatever.
I would very much appriciate any input or ideas on what I could do. If I need to clarify the problem more let me know.
Thanks
~Rasmus
You'll want to explore enabling iTunes file sharing in your app. Here's one blog post that explains some of the steps: http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app .

Putting a url in an email that opens an application on iPhone or iPad

I know what code is needed to cause my iOS app to open a link in Safari. But I am looking at how I might accomplish something more in the reverse direction.
I can send email from my app. I would like to include a link in the email, that, when clicked on within the email on my iPhone or iPad, will open my app and perform an action based on the property values passed in the link. (The link would refer to a record in the database of my app, so the app can provide a view content based on that record.)
Another example I have seen is the special purpose URL used in the manifest file that loads ad hoc distributions over the air.
I see something like this when places and dates are automatically converted to links that open the map or calendar applications.
Does anyone have an idea how I can do this?
You need to implement a custom URL scheme.

Is there a function which lets you add functionality to an existing app on ios?

I am curious if it is possible to make an app that adds a functionality to an existing app on ipad, say safari. If yes, which function would add a button to safari?
My question is based on 2 app advertisements I saw, one added a button to safari, the other created an app itself. I didnt buy them yet, so I dont know if they really do what thet say.
Thanks
As far as I'm aware, I think the closest you get to adding functionality to an existing app would be creating a new app that allowed interaction with certain document types.
For example, you might create an app that can open and read PDF documents. On installing this app, you would then find that interacting with a PDF document on any app (such as in an email attachment, or opening a PDF in Safari) would show a new option to open the PDF in your app. This kind of interaction is achieved via the UIDocumentInteractionController class.
Beyond that, I believe you would have to create your own app from scratch based on an existing one in order to extend functionality (so, create the 'MyBrowser' app to behave like Safari, except with additional controls and features).
I'd love to be proven wrong, however.

Resources