Discussion Forums  >  Uncategorized

Replies: 17    Views: 596

mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
03/03/11 08:58 AM (14 years ago)

emailing pdf files from within app?

My app contains several pictures and pdf's of various algorithms, SOPs, guidelines, etc. All of these files are contained within the app itself. Would it be possible to add a button of some sort allowing the user to email/text themself the file they are currently viewing? Thanks, Josh
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/03/11 10:06 AM (14 years ago)
Hmm... this is an intereseting idea. Thinking.... If the PDF's are coming from a URL (and not dragged into Xcode and included in the project), you could do this... On the PDF screen's advanced settings, you could 'Show Launch in Native App' button. This would then open the PDF in Safari, allowing the user to share, email, etc. I can't remember if Safari allows you to email the actual file or just a link to it - a link may be good enough? Lemme know if this makes sense. And... also... this won't work unless the PDF is coming from a URL.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
03/03/11 02:48 PM (14 years ago)
I was initially hoping to include all these files in the project itself but maybe for some of the larger pdf files, which are the ones I'm more interested in having the ability to download, it would make more sense to keep them online to minimize the size of my app. Hmm, I'll give it a try, thanks!
 
R2-D2
Apple Fan
Profile
Posts: 95
Reg: Jan 20, 2011
East Coast USA
950
like
03/03/11 03:34 PM (14 years ago)
1) If the user views a PDF within the app, they should have the option to open it in iBooks, where they can store it, email it or print it. Perhaps no need to reinvent the wheel. Just make them aware they have that ability and I think you're all set. 2) Yes, might be a good idea at least for the larger PDF's to host them online rather than in the app. Either way the experience of viewing will be similar for the user (except for the time to download and requirement for a data connection at that time... mostly a non-issue unless it's something like a wilderness reference where there is a likelihood they might be off the grid)
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
03/03/11 03:52 PM (14 years ago)
I've seen the option to view a pdf file in iBooks if I access the file through my email, but when I open pdf files within my app while testing (and the pdf file was dragged into my xcode project), I'm not given the option to view it in iBooks. I'll just keep the file online for now. Thanks for the input
 
R2-D2
Apple Fan
Profile
Posts: 95
Reg: Jan 20, 2011
East Coast USA
950
like
03/03/11 03:54 PM (14 years ago)
Ok, good to know, I hadn't tried it out yet. When you host the file online, are you able to view in iBooks?
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/02/11 04:29 PM (14 years ago)
I am working on an app now that will include dozens of pdf forms that need to be completed on the iPad and then emailed. By installing another app such as Sign-N-Send or SignMyPad, after launching the pdf file in Safari you can the open the pdf in one of these apps, complete the form and email the completed pdf file. The iBooks option mentioned above also works to email the pdf if it's hosted online. The pdf files are hosted online. Is it possible when launching Safari to hide the nav bar so the URL is not visible? Thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/03/11 01:22 AM (14 years ago)
You won't be able to hide the nav bar in Safari. There are some tricks to make it scoll up and out of the way but the user can scroll it back down. Also, you can't do this without special markup in the HTML. If you're linking to a PDF you don't have any HTML. Can you do this instead: If you're backend understood who was logged in, could you just make a temporary link for them, one that exprired? Maybe a 'registered users only' screen with a menu of links to the PDF's. The menu data comes from your server. Just an idea.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/03/11 04:08 AM (14 years ago)
Thanks very much for your suggestion David. The purpose of this app is to put a complete set of pdf forms for a specific business on an iPad, enter information on the forms using SignMyPad and then email the completed forms. One option is to put the pdf in the pdf screen, show launch in native app button, open in Safari and at the point an available option is to open the file using SignMyPad if SignMyPad is installed on the iPad. This works, but I don't want the user to see the URL of the pdf file. Is there a way to open the pdf file using SignMyPad directly from initial pdf screen by adding open in functionality instead of having to open in Safari first? Is open in Safari hardcoded in open in native screen? Any pointer on how to modify that screen so open in function would find other registered apps? Other options? Thanks very much!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/03/11 12:35 PM (14 years ago)
I'm not familiar with SignMyPad but it sounds like a native app. If this native app uses a Custom URL scheme you could enter it on the Launch Native App feature. This would allow you to create a menu of PDF's that automagically launch in the SignMyPad application. Again, that app must support this functionality. See this: http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/03/11 12:44 PM (14 years ago)
SignMyPad is automatically offered as an option to open pdf files when the file is in Safari so I think it's a native app. I read the article you referenced above; a little confusing to me. How do I find out the Custom URL scheme or is this something I create? Or did the app developer register a custom with the system like http://SignMyPad? Thanks. I just contacted the developer of the SignMyPad app and asked if it uses a custom url scheme - he replied No we don't - we just have SignMyPad use the CFBundleType line for PDF's - this tells the iPad that anything that reads PDF's can open them in SignMyPad. That's where the Open In button takes it's commands from. If your app is using PDF's it should recognize the PDF and open with SignMyPad. Take a look into CFBundleType and UIDocumentInteraction. This info is over my head!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/03/11 09:56 PM (14 years ago)
OK, I understand. This stuff does get techie sometimes! I've contacted the developer of SignMyPad and will post a solution when hear from them.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/04/11 05:08 AM (14 years ago)
Great! Justin, the developer has been very responsive to all my requests for info so I'm sure he'll respond quickly to you. This will be a great solution for anyone who wants to develop an app that includes pdf forms that need to completed, signed, saved and emailed. Thanks very much David!
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/04/11 12:01 PM (14 years ago)
Hi David, Did you hear from the SignMyPad developer?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/04/11 08:10 PM (14 years ago)
Yup, a few times, dialogue still going. I didn't realize he was running your code. He sent a screen shot with the last remark of the PDF open in Safari, along with the button showing the other 'open in' options like DropBox and SignMyPad. He didn't seem to understand what I was asking. I totally understand how to open a PDF in Safari (he didn't think I was doing it 'the right way') but I don't understand how how to open the SignMyPad app directly. Here's the discussion: http://getsatisfaction.com/autriv/topics/launch_signmypad_from_third_party_ios_app?utm_content=topic_link&utm_medium=email&utm_source=reply_notification I'm still waiting for him to tell us if we can open the SignMyApp app directly without first opening Safari.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/05/11 04:00 AM (14 years ago)
Hi David, I read the discussion. Here's what I want to accomplish; Include pdf files in the app, either bundled in app or called by URL, that can be loaded into a page that has the open in... function button. If SignMyPad is installed it would show as on option to use for opening the page. I do not need to open SignMyPad directly; it does not use Custom URL scheme. The way the pdf screen functions now, when I add Show Launch in Native App Button, the button added does not offer the open in... function. It is coded to open Safari. After the pdf is in Safari the open in function is available and open in SignMyPad is an option. Justin suggested - So a button needs to be coded as a normal Open In button; CFBundleType and UIDocumentInteraction modification needed. So I don't think the discussion is about the right or wrong way to open a pdf in Safari, it is about the Native App Button launching Safari or instead having a button that would provide the open in function; if the file was a pdf, SignMyPad would be one of the options. Could this type of code be added as an option under Document Behavior or would it require adding a new screen type option? As I mentioned in a prior comment, this is a little over my head so I hope my explanation makes sense. As always, thanks very much for your help.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/05/11 05:34 AM (14 years ago)
Hi again. I understand what you're saying and what the other developer is saying. I also understand exacly what your asking about. However, there is no such thing as an 'open in button' that can be created, literally created with Objective C. Example: In Xcode, open up interface builder, look at all the things you can add to a screen or view, an 'open in button' is not a choice. Now, of course you can add / create all sorts of buttons and controls. That's all we are doing, showing a button that is programmed to open Safari. However, there is a UIDocumentInteractionController Class available in the iOS framework that's designed to show a menu of options for ways to handle a document (print, preview, etc) for a user to choose from. I've not worked with this iOS framework and it's only available on devices > 3.2. I can't lend any advice on how it may work or not work for this situation. Without being able to target that application with a URL your only option sounds like figuring out how the UIDocumentInteractionController works in iOS. This isn't something I can get to anytime soon. You could have a look at UIDocumentInteractionController in Google and see what it's all about?
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
06/09/11 08:33 AM (14 years ago)
Thanks for checking David.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.