I need to open a locally saved file in my documents directory in Microsoft Word for doc files or PowerPoint for ppt files.
I've used the UIDocumentInteractionController which works to open these documents, problem is that the client doesn't want to show all the options to open the document and restrict it just to Word or PowerPoint.
self.docController = [UIDocumentInteractionController interactionControllerWithURL:attachmentURL];
So then I used the UIActivityViewController to restrict the options, but without even using UIActivityViewController.excludedActivityTypes the Microsoft options no longer appear using the same NSURL.
self.activityViewController = [[UIActivityViewController alloc] initWithActivityItems:#[attachmentURL] applicationActivities:nil];
Not sure what I'm missing? Or is it possible to open the documents without using either of these classes?
Related
I am writing an iOS plugin for Unity in Objective-C. I have created a DocumentPicker which allows me to select Folders. However, it does not seem to have access to Third-party storage (such as OneDrive, DropBox, etc).
I am certain I have the permissions for this, because I have also created a DocumentPicker within the same Application which allows me to select Zip files; the Zip file DocumentPicker has no problem browsing these third-party storage areas.
Here is how I am declaring the DocumentPicker instance for Folder selection:
[[UIDocumentPickerViewController alloc] initWithDocumentTypes:#[#"public.folder"] inMode:UIDocumentPickerModeOpen];
Likewise, here is the fully-functioning declaration for the Zip file selection:
[[UIDocumentPickerViewController alloc] initWithDocumentTypes:#[#"public.zip-archive"] inMode:UIDocumentPickerModeImport];
Here is a screencapture of inaccessible Third-party storage in grey, while local storage and iCloud remain accessible in white
I thought perhaps Microsoft, Google, etc, haven't implemented a Document Provider extension for Folder selection, but that seems a bit of a stretch.
Can anyone tell me what I'm doing wrong? Thank you.
According to this post it is not implemented by Dropbox, so one could assume this is the same issue with OneDrive, etc.
I had a problem to display .docx file in UIWebView. It is not showing digram properly. It looks stretched and mixed with other text file.
I am using below code to display .docx file.
NSURL *url = [NSURL fileURLWithPath:#"File Name"];
[self.webView loadRequest:[NSURLRequest requestWithURL:url]];
Opening a web view may cause Word files to look distorted. Its similar to when certain word files look distorted when opened in Pages application.
The web view may not be able to exactly render the doc file the way it was created and you cannot do anything about it.
You may want to look at the QuickLook Framework for iOS:
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/UsingtheQuickLookFramework.html
It supports the following formats:
iWork documents
Microsoft Office documents (Office ‘97 and newer)
Rich Text Format (RTF) documents
PDF files
Images
Text files whose uniform type identifier (UTI) conforms to the public.text type (see * Uniform Type Identifiers Reference)
Comma-separated value (csv) files
More specifically you may want to look at the QLPreviewController: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/QLPreviewController_Class/Reference/Reference.html#//apple_ref/occ/cl/QLPreviewController
I have an app that stores data and files in CoreData. Some files are photos, and I can display them, some are excel and word files. What is the best way to view them? Should I save em on filesystem and open with url? Does there is some controller in UIKit to display them?
Did you tried to use QLPreviewController before
Check out this url for details
QLPreviewController
It's responsible for opening PDF, .XCL, .word files.
Or for a quick viewer you can load the files in UIWebView
What I Have Done:
I'm developing an application where it transfers different type of files (Eg: Images, Word Docs, Videos) between iOS devices. I'm keeping those files inside the app. I have successfully implemented iCloud Drive to share files from other applications (Eg: Documents). This is how it's done,
UIDocumentPickerViewController *documentPicker =
[[UIDocumentPickerViewController alloc] initWithDocumentTypes:
#[(__bridge NSString *) kUTTypeContent,
(__bridge NSString *) kUTTypeData,
(__bridge NSString *) kUTTypePackage,
#"com.apple.iwork.pages.pages",
#"com.apple.iwork.numbers.numbers",
#"com.apple.iwork.keynote.key"]
inMode:UIDocumentPickerModeImport];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];
[documentPicker release];
Objective:
I want to make my application files (Eg: Images, Word Docs, Videos) store inside the folder "Documents/Files" to be accessible via another app (Like Documents).
R & D:
This is the reference doc I'm reading to achieve this. I manage to create a folder of my app by editing the info.plist. But couldn't display my files stored inside documents directory.
Questions:
Is it possible to make the files I have stored inside documents directory visible to another app via UIDocumentsPicker or something else?.
If it is possible, is there a much easier reference document for me to read? (The current one that I'm reading is a bit difficult to understand).
Thanks.
When I click on button need to read the PDF file in windows phone 7, I am saving the PDF file in a folder and given the specified path in Database.
How can I read the PDF document on a windows phone 7?
There are 3 ways to open PDF file on Windows Phone:
Use "native" PDF viewer - Adobe Reader
To do that, you need a location URI of your PDF file, and then you
can either use the HyperlinkButton
<HyperlinkButton Content="Click here to open PDF"
NavigateUri="URI of your PDF" TargetName="_blank" Margin="10,60,0,0"/>
or you could use the WebBrowser task to browse to the PDF which will
invoke the PDF viewer:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = "URI of your PDF";
browser.Show();
Use ComponentOne control for viewing PDFs
http://www.componentone.com/SuperProducts/PdfViewerPhone/
This will cost you some money, but should work OK.
Write your own control for rendering PDFs :)))