We're sorry GroupDocsApp doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.app

Docx to pdf - Cannot convert. The file is corrupt or damaged

We have a Word document that we read and save in C# like this:

using (var doc = WordprocessingDocument.Open(docStream, true, GetOpenSettings()))
{
     var x = doc.MainDocumentPart.Document.Body; **// Without this code line it works!**
     doc.Save();
}

The Word document contains a checkbox field.
It looks like this:
WordDocumentWithASimpleCheckbox.png (534 Bytes)

After save(), the document cannot be converted neither by GroupDocs.Conversion nor by Online-Converter https://products.groupdocs.app/conversion/total

It seems, that GroupDocs cannot convert a regular document if it looks like “OpenXml_corrupt.png” below:

OpenXml_original.png (16.7 KB)
OpenXml_corrupt.png (14.5 KB)

But this is a valid OpenXml document saved by Microsoft NuGet “DocumentFormat.OpenXml” V2.16.0

Attachments:
Testdokument_repaired.docx (11.9 KB)
Testdokument_corrupt.docx (11.5 KB)
Testdokument_original.docx (11.8 KB)
OpenXmlDocumentsAsXml.zip (2.9 KB)

See also:
Testproject.zip (1.7 MB)

This topic has been moved to the related forum: https://forum.groupdocs.com/t/docx-to-pdf-cannot-convert-the-file-is-corrupt-or-damaged/11307