1

I have word files (.docx) having different type of language in each (e.g English, Urdu, Arabic etc) i want to extract that data as string but i can't access the

officeOpenXML in attributed string document type.

Xcode gives the following error

Type "NSAttributedString.DocumentType" has no member "officeOpenXML"

How can i load the data in string?

  • 1
    It's available on macOS (well to be precise, 10.5+), not in iOS: See there: https://developer.apple.com/documentation/foundation/nsattributedstring/documenttype/1534334-officeopenxml You have to either do the parsing yourself, or use a third library to do so (may have to pay). – Larme Sep 28 '18 at 13:59
  • @Larme thanks for the info. can u please guide me regarding parsing, i have only have NSData that is returned by function. – Muhammad Umair Gillani Sep 28 '18 at 14:02
  • 4
    If I remember correctly, docx are XML files inside a .zip. But it's quite a complexe protocol (after all there are plenty of options: adds tables, graphics, images, etc.). So you'll have to do it by yourself. It's too broad to explain how it works (and maybe kinda proprietary). – Larme Sep 28 '18 at 14:03
  • thanks for your time :) – Muhammad Umair Gillani Sep 28 '18 at 14:05
  • 1
    You can maybe find some infos there: https://stackoverflow.com/a/38918679/1801544 – Larme Sep 28 '18 at 14:05

0 Answers0