How to create and save .rtf, .doc, .docx in Objective-C for iOS

I am looking to create and save an rtf, doc or docx file on an iPad (iOS).

The scenario is that we would like to help the user to create content on their iPad, and then allow them to send it by e-mail in the form of an editable cross-platform platform (OS X, WIN).

I am open to other solutions besides rtf, doc or docx file format.

Thanks,

James

+4
source share
3 answers

RTF will be the easiest because it is a simple text format. This is similar to HTML, but without closing tags. Here is the class for writing RTF, but this requires a lot of dependencies from other sources within the framework.

DOCX would be quite difficult. This is actually a zip file containing multiple XML files. You can learn the format yourself by changing the .docx extension to .zip and unzipping it. But even though the XML format is pretty simple to write, the way to structure text attributes is still pretty complicated. In addition, I remember that it needs to be cleaned in a very specific way so that it can be read correctly.

As for the DOC, it will be very difficult because it is such a complex format. You can see some open source projects like Abiword or Word2x . Be careful using your code because licenses may not comply with Store Store policies.

+7
source

I have seen doc and docx readers for the iPhone (the App Store entry listed here ), but I don’t know any open source frameworks you can use.

The RTF format should be fairly easy to write if you solve the problem. There is no built-in framework support for it ( here is a related question, btw ).

Maybe you could write something in the usual TEXT format and by email?

+1
source

Docmosis has a cloud service that you can get from iOS. You can ask him to provide a document in various formats (doc, rtf, pdf, odt, etc.) and send it by email or send it back - although you must be connected. DOC preview on iOS is possible, but a little flaky. One option is to transfer the PDF back to display an editable document on iOS and email (which can be done in one go).

0
source

Source: https://habr.com/ru/post/1382606/


All Articles