Aspose.Words Markdown Generation Fails for Specific Template Documents

Hello Aspose Support Team,
We are facing an issue while converting certain Word template documents (.docx) into Markdown format using Aspose.Words.

Issue Summary
Service: TextExtractor
Operation: Word (.docx) → Markdown conversion
Problem: Markdown generation fails for some specific template documents
Behavior: Conversion works for most documents, but fails consistently for certain templates
Error Details
The conversion fails with an internal Aspose exception related to shape rendering. Below is the stack trace observed:

at sC4.d()
at RCu.d(ShapeBase d, Byte[] v, Int32 c, Int32 t, uf n, Boolean B)
at qCu.v(ShapeBase d, Byte[] v, Int32 c, Int32 t, uf n, Boolean B)
at qCu.d(ShapeBase d, Byte[] v, Int32 c, Int32 t, uf n, Boolean B, Boolean b)
at qCu.d(ShapeBase d, ShapeRenderer v, uf c, Boolean t, vCZ n)
at q
Cu.d(Shape d, ShapeRenderer v, vCZ c)
at qCu.d(Shape d, vCZ v)
at qCu.d(ShapeBase d, vCZ v)
at sCu.d(ShapeBase d)
at sCu.d(Shape d)
at lCu.VisitShapeStart(Shape d)
at Aspose.Words.Drawing.Shape.AcceptStart(DocumentVisitor visitor)
...
at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)

The failure occurs during shape processing when saving the document as Markdown.
Observations
The issue seems related to specific shapes or embedded objects within the Word template.
The same document fails consistently across runs.
Other Word templates convert to Markdown successfully.
This issue is reproducible in our environment.
Attachments
A sample failing Word document (.docx) is attached for reproduction.
Screenshots showing the affected prompt/template context are also attached.
Request

Could you please:
Investigate whether this is a known issue with Markdown export and shape handling.
Advise if this is a bug, limitation, or requires a workaround.
Suggest any configuration or preprocessing steps to avoid this failure.
Please let us know if you need additional logs or environment details.

Thanks in advance for your support.

Please find attached document.

6a49713c-1945-42a7-b609-03c93d386c1c_logo_with_lorem_ipsum.docx (128.4 KB)

@omkar.kothavale

  • Is the error reproducible with the same document when using the latest version of Aspose.Words?
  • Are the shapes in the failing document standard (e.g., rectangles, arrows) or do they include OLE objects, charts, or third-party embedded content?
  • Does the conversion succeed if shapes are manually removed or replaced in the template before conversion?
  • Can you confirm whether the failure occurs only with Markdown output, or do other formats (e.g., HTML, PDF) also fail for the same document?

@omkar.kothavale Could you please attach the problematic input document here for testing? We will check the issue and provide you more information. Unfortunately, I do not see any attachments in your initial post.

Hi, please find attached document
6a49713c-1945-42a7-b609-03c93d386c1c_logo_with_lorem_ipsum.docx (128.4 KB)

@omkar.kothavale Unfortunately, I cannot reproduce the problem on my side using the latest 25.12 version of Aspose.Words and the following simple code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.md");

There is an image in your input document, so if you are converting document to Markdown and saving the output to stream you should either embed the image into the file using MarkdownSaveOptions.ExportImagesAsBase64:

Document doc = new Document(@"C:\Temp\in.docx");
using (MemoryStream ms = new MemoryStream())
{
    MarkdownSaveOptions opt = new MarkdownSaveOptions();
    opt.ExportImagesAsBase64 = true;
    doc.Save(ms, opt);
}

or specify folder where the images should be saved using MarkdownSaveOptions.ImagesFolder:

Document doc = new Document(@"C:\Temp\in.docx");
using (MemoryStream ms = new MemoryStream())
{
    MarkdownSaveOptions opt = new MarkdownSaveOptions();
    opt.ImagesFolder = @"C:\Temp\";
    doc.Save(ms, opt);
}

or save the image using MarkdownSaveOptions.ImageSavingCallback.