Free Support Forum - groupdocs.com

Unable to convert "Word XML" format. Is it supported?

When I try to convert the attached document saved as “Word XML”, GroupDocs.Conversion throws:

GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: Cannot convert. The file is corrupt or damaged.

That said, is the format supported? I tried searching the site and the forums and got no results.

Thanks
-Jonathan

(attached here within a zip fileWord.zip (153.1 KB)
)

1 Like

@jisabell

Please have a look at the supported file formats. API doesn’t support conversion to XML. However, we’ll investigate the possibility to add support for such a format. Your investigation ticket ID is CONVERSIONNET-4508.

Sorry. I should’ve been more clear. I’m creating this document by saving from Word in the format “Word XML” and then attempting to convert using GroupDocs.Conversion to TIFF when I get the error. I’ve tried saving a few documents in this format and converting them with GroupDocs.Conversion but I get the error below.

        var options = new ImageConvertOptions { Format = ImageFileType.Tiff, };

        const string workFolder = @"C:\Test";
        var sourceFile = Path.Combine(workFolder, "Word.xml");
        var targetFile = Path.ChangeExtension(sourceFile, $"{options.Format}");
        Console.WriteLine($"Converting {sourceFile} to {targetFile}.");
        using (var inputStream = File.OpenRead(sourceFile))
        {
           using (var converter = new GroupDocs.Conversion.Converter(() => inputStream)) 
           {
              using (var outputStream = new FileStream(targetFile, FileMode.OpenOrCreate))
              {
                 converter.Convert(() => outputStream, options);
              }
           }
        }

Output:

Converting C:\TestRF\Word.xml to C:\TestRF\Word.tiff.
Error: GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: Cannot convert. The file is corrupt or damaged.
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)
at GroupDocsConsoleTest.Program.Main(String[] args) in C:\rcs\GroupDocsConsoleTest\GroupDocsConsoleTest\Program.cs:line 34

Is there a way I can make this work?
Thanks
-Jonathan

1 Like

@jisabell

Thank you for the clarification. This issue is reproduced at our end. We’ve updated the ticket CONVERSIONNET-4508 with the relative issue details. You’ll be notified in case of any update.

1 Like