Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Dec 01, 2025 10:11 am

Hi,

I have the following code-snippet:
Code: Select all
         string markdown = "1. Test\r\n2. Test\r\n3. Test";
         var document = new Document();
         using (var content = new MemoryStream(Encoding.Default.GetBytes(markdown)))
         {
            document.LoadFromStream(content, FileFormat.Markdown);
         }
         document.SaveToFile("C:\\tmp\\convert.markdown.pdf", FileFormat.PDF);


I would expect this to give a a document with only a numbered list. But the list seems so be indented starting at number 2. This is not the correct/expected behavior.

MarcelEmpirion
 
Posts: 6
Joined: Fri Jan 02, 2015 8:26 am

Tue Dec 02, 2025 3:25 am

Hello,

Thank you for your inquiry.
I have reproduced the issue you reported. The cause of this problem is that Spire.Doc currently does not fully support converting Markdown in string format to DOC/PDF files. I have logged this issue into our product upgrade system under ticket number SPIREDOC-11705. Our development team will investigate this matter. Once it is resolved or there are any updates, I will notify you immediately. We apologize for any inconvenience caused.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Fri Jan 16, 2026 4:01 am

Hello,

Thank you for your patience.
Regarding issue SPIREDOC-11705, according to Markdown syntax specifications, creating a new paragraph requires leaving an empty line between paragraphs. To achieve your expected results, please refer to the following code:
Code: Select all
string markdown = "1. Test\r\n\r\n2. Test\r\n\r\n3. Test";
var document = new Spire.Doc.Document();
using (var content = new MemoryStream(Encoding.Default.GetBytes(markdown)))
{
    document.LoadFromStream(content, Spire.Doc.FileFormat.Markdown);
}
document.SaveToFile("markdown.pdf", Spire.Doc.FileFormat.PDF);

We look forward to your feedback.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.Doc