Error when convert DOC file to HTML file by Aspose.Words Python via .Net (Ubuntu 24)

I got an error when I tried to save a DOC file in HTML format on Ubuntu 24
I applied for the license, but it only works with DOCX files


The code still works on Windows
This format may make Aspose.words broken on Ubuntu

@minhd

It seems you are encountering an issue when trying to convert a DOC file to HTML format using Aspose.Words for Python via .NET. While the library supports a wide range of document formats, including DOC and DOCX, there are some considerations to keep in mind.

  1. Supported Formats: Ensure that the version of Aspose.Words you are using supports the DOC format for conversion to HTML. The library is designed to handle various document formats, but it’s essential to verify that the specific format you are working with is supported in your version.

  2. Licensing: You mentioned that the license only works with DOCX files. If your license is limited to certain formats, it may restrict the functionality for DOC files. Check your license details to confirm which formats are included.

  3. Error Handling: If you are receiving a specific error message during the conversion process, it would be helpful to review that message. Common issues can arise from document corruption, unsupported features in the DOC file, or incorrect usage of the API.

  4. Code Example: Here’s a basic example of how to convert a DOC file to HTML using Aspose.Words:

    import aspose.words as aw
    
    # Load the DOC file
    doc = aw.Document("input.doc")
    
    # Save the document as HTML
    doc.save("output.html", aw.SaveFormat.HTML)
    

If you continue to experience issues, consider checking the official documentation for more details on supported formats and troubleshooting tips. Additionally, you may want to reach out to Aspose support for further assistance regarding your specific license and its capabilities.

If you have any specific error messages or additional details, feel free to share them for more targeted help!

@minhd Please try installing ICU package in your environment:

apt-get install -y pkg-config libicu-dev

I installed the ICU package using apt-get install -y pkg-config libicu-dev
I’m still getting an error when running aspose to extract html from a .docx file:

Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.StringComparer..cctor()
   at System.Text.EncodingTable..cctor()
   at System.Text.EncodingTable.GetCodePageDataItem(Int32)
   at System.Text.Encoding.GetDataItem()
   at System.Text.Encoding.get_WebName()
   at System.Xml.XmlTextReaderImpl.SwitchEncoding(System.Text.Encoding)
   at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean)
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(System.Xml.XmlDocument, System.Xml.XmlReader, Boolean)
   at System.Xml.XmlDocument.Load(System.Xml.XmlReader)
   at System.Xml.XmlDocument.Load(System.IO.Stream)
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.MethodBase.Invoke(System.Object, System.Object[])
   at w.YE(System.Reflection.MethodBase, System.Object, System.Object[])
   at w.tE(System.Reflection.MethodBase, System.Object, System.Object[], Boolean)
   at w.nE(System.Reflection.MethodBase, System.Object, System.Object[], Boolean)
   at w.Pg(System.Reflection.MethodBase, Boolean)
   at w.kK(w, B)
   at w.Ng()
   at w.hm(Boolean)
   at w.Uu(System.Object[], System.Type[], System.Type[], System.Object[])
   at w.Yg(Int32, System.Type[], System.Type[], Boolean)
   at w.R3(w, B)
   at w.Ng()
   at w.hm(Boolean)
   at w.Uu(System.Object[], System.Type[], System.Type[], System.Object[])
   at w.Mu(System.IO.Stream, System.String, System.Object[], System.Type[], System.Type[], System.Object[])
   at w.Xu(System.IO.Stream, System.String, System.Object[])
   at w.Ju(System.IO.Stream, System.String, System.Object[])
   at Aspose.Words.License.SetLicense(System.IO.Stream)
   at WrpNs_Aspose.WrpNs_Words.WrpCs_License_C070DFB8.call_001_SetLicense(IntPtr, Aspose.WrpGen.Interop.VariantArg*)

@b.pereira Which Linux distribution do you use? For example, libicu does not work properly on Debian. To make it work it is required to install libicu66 after libicu. Please see Dockerfile for Debian on our github:
https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET/blob/master/Dockerfile
You can find it at the end of the file.

Also, you can try installing an older version of ICU:

RUN wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu70_70.1-2_amd64.deb
RUN dpkg -i libicu70_70.1-2_amd64.deb