Opening Embedded .docx file in a Xamarin.iOS Project

Hi,

I am trying to open a .docx file on a Xamarin.iOS project as a Aspose.Words.Document. Program works well on a Xamarin.Android project but on Xamarin.iOS project, it gives the following error

Aspose.Words.UnsupportedFileFormatException
Unknown file format: Unknown

  • I have added the file into project as BundleResource. When I try to open the file with ReadWrite access, it fails. So, I tried to copy the content of the file to somewhere else. Even tough I can open that file with ReadWrite access still Aspose gives same error.

  • Also, I tried to open the file and give the FileStream to Aspose. It gave me the same error.

  • Furthermore, I tried to give LoadOptions to constructor as following:

    Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
    loadOptions.LoadFormat = Aspose.Words.LoadFormat.Docx;
    var doc = new Aspose.Words.Document(filePath,loadOptions);

    It didn’t work as well.

  • Finally, I need to mention that I tried to different DLLs of Aspose.Words for that. One of them was the NuGet package and the other one was downloaded from here. Both didn’t work as well.

So, I am out of solutions. I would be glad, if you can help me with that.

@ilkan.engin,

As mentioned in ‘Xamarin Platform Notes’ section of Xamarin and .NET Standard 2.0 API Differences and Limitations page, please ‘Check for Updates’ in Visual Studio and download and install latest update of Xamarin.iOS. Hope, this helps.

In case the problem still remains, please ZIP and upload your input Word document here for testing. We will investigate the issue on our end and provide you more information.

1 Like

Oh, I didn’t know that I needed to check the ticks for Codesets. When I do that, it worked like a charm! Thank you for your support!

@ilkan.engin,

Thanks for your feedback. In case you have further inquiries or need any help, please let us know.

1 Like