I have a Word document, and after I convert it to MD format with ExportImagesAsBase64
param as true, the pictures are displayed abnormally when i open with md editor Typora.
void Main()
{
var doc = new Aspose.Words.Document(@"C:\Users\54390\Downloads\md-4dbeec56f6734d7c854d7db35eb25e56 (1).docx");
var opts = new Aspose.Words.Saving.MarkdownSaveOptions(){
ExportImagesAsBase64 = true
};
doc.Save(@"C:\Users\54390\Downloads\output.md", opts);
}
Version info:
Aspose.Words for Net 23.2
The demo file:
md-4dbeec56f6734d7c854d7db35eb25e56 (1).docx (1.5 MB)
The output file:
output.zip (424.6 KB)
The screenshot:
![](https://forum.aspose.com/uploads/default/75108)
@sullivan According to Markdown specification the image looks valid.
https://www.markdownguide.org/basic-syntax/#images-1
But it looks like not all Markdown viewers support base64 images. For example the following syntax:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAAApCAYAAADd7bxVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAILSURBVHhe7ZFhbiwxCIP3IP3Z+9+sZ2gbS1RRnknCBGaZJyx92tU4MQFev/ou0gMxozjk6+OTfr8IxIzikFpUMF4DrkUF0QbrOdyUi3J+1G3IciLen3JRUfSD7GFnLXjlzHDOh5jxdmaNXhmCLMd5gCrOdSBmvJVVk1eGcNeChFSLimh+J9Na9+4lNdIs6l1LamRfVEA9iBlLalE6lj42z0LMmBLRuCXzSv2IN2vMajVPYL4CxIwpEU1bMq/Uj3izBqvVvh28AWKGym4xy6OsZ682fHJXkIxZ1nhGO2cA+vuwEz4rurqrYTlvzWZ4ZAjS7wg7ewDEDMAKj//ZGQu7905qMLzzegKyIWb8gxQfYWct7GZ41GJ49THinAkxg/KOhqIGOeJd5ySL3IXGjyoRA9My2/eIeiu86p5kkLvQ+FElYnCS2X5HxrN34VH/JIPcg8aPKqePZ2TM9HpTyxGYr0HOQ+NHFa8GerJktjsC80/os3cgGRAzKErIEd6ZljwZTERfzkDMoEQ15Jm7m/WA5fRAzKBkXlTL2MnZPZcMiBmUqAZPc//jBQkQMyiRjV7NXt17+IIEiBmUk6a9B7o6L74lMzEQM6ZYBmAZWH92BbvfWPkPBWLGFv3gNNi9wgzEjCIXEDOKXEDMKHIBMaPIBcSMIhcQM4pcQMwocgExo8gFxIwiF6Vn6PX6AcUYcZuDebiXAAAAAElFTkSuQmCC)
Is properly interpreted by this forum Markdown engine. See the image below:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAAApCAYAAADd7bxVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAILSURBVHhe7ZFhbiwxCIP3IP3Z+9+sZ2gbS1RRnknCBGaZJyx92tU4MQFev/ou0gMxozjk6+OTfr8IxIzikFpUMF4DrkUF0QbrOdyUi3J+1G3IciLen3JRUfSD7GFnLXjlzHDOh5jxdmaNXhmCLMd5gCrOdSBmvJVVk1eGcNeChFSLimh+J9Na9+4lNdIs6l1LamRfVEA9iBlLalE6lj42z0LMmBLRuCXzSv2IN2vMajVPYL4CxIwpEU1bMq/Uj3izBqvVvh28AWKGym4xy6OsZ682fHJXkIxZ1nhGO2cA+vuwEz4rurqrYTlvzWZ4ZAjS7wg7ewDEDMAKj//ZGQu7905qMLzzegKyIWb8gxQfYWct7GZ41GJ49THinAkxg/KOhqIGOeJd5ySL3IXGjyoRA9My2/eIeiu86p5kkLvQ+FElYnCS2X5HxrN34VH/JIPcg8aPKqePZ2TM9HpTyxGYr0HOQ+NHFa8GerJktjsC80/os3cgGRAzKErIEd6ZljwZTERfzkDMoEQ15Jm7m/WA5fRAzKBkXlTL2MnZPZcMiBmUqAZPc//jBQkQMyiRjV7NXt17+IIEiBmUk6a9B7o6L74lMzEQM6ZYBmAZWH92BbvfWPkPBWLGFv3gNNi9wgzEjCIXEDOKXEDMKHIBMaPIBcSMIhcQM4pcQMwocgExo8gFxIwiF6Vn6PX6AcUYcZuDebiXAAAAAElFTkSuQmCC)
So this is not a defect in Aspose.Words, but limitation of the viewer.
As you may know Markdown allows injecting HTML syntax, so the following HTML should be handled by Markdown viewers:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAAApCAYAAADd7bxVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAILSURBVHhe7ZFhbiwxCIP3IP3Z+9+sZ2gbS1RRnknCBGaZJyx92tU4MQFev/ou0gMxozjk6+OTfr8IxIzikFpUMF4DrkUF0QbrOdyUi3J+1G3IciLen3JRUfSD7GFnLXjlzHDOh5jxdmaNXhmCLMd5gCrOdSBmvJVVk1eGcNeChFSLimh+J9Na9+4lNdIs6l1LamRfVEA9iBlLalE6lj42z0LMmBLRuCXzSv2IN2vMajVPYL4CxIwpEU1bMq/Uj3izBqvVvh28AWKGym4xy6OsZ682fHJXkIxZ1nhGO2cA+vuwEz4rurqrYTlvzWZ4ZAjS7wg7ewDEDMAKj//ZGQu7905qMLzzegKyIWb8gxQfYWct7GZ41GJ49THinAkxg/KOhqIGOeJd5ySL3IXGjyoRA9My2/eIeiu86p5kkLvQ+FElYnCS2X5HxrN34VH/JIPcg8aPKqePZ2TM9HpTyxGYr0HOQ+NHFa8GerJktjsC80/os3cgGRAzKErIEd6ZljwZTERfzkDMoEQ15Jm7m/WA5fRAzKBkXlTL2MnZPZcMiBmUqAZPc//jBQkQMyiRjV7NXt17+IIEiBmUk6a9B7o6L74lMzEQM6ZYBmAZWH92BbvfWPkPBWLGFv3gNNi9wgzEjCIXEDOKXEDMKHIBMaPIBcSMIhcQM4pcQMwocgExo8gFxIwiF6Vn6PX6AcUYcZuDebiXAAAAAElFTkSuQmCC" width="106" height="41" />
Like Markdown engine of this forum does. See the image below:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAAApCAYAAADd7bxVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAILSURBVHhe7ZFhbiwxCIP3IP3Z+9+sZ2gbS1RRnknCBGaZJyx92tU4MQFev/ou0gMxozjk6+OTfr8IxIzikFpUMF4DrkUF0QbrOdyUi3J+1G3IciLen3JRUfSD7GFnLXjlzHDOh5jxdmaNXhmCLMd5gCrOdSBmvJVVk1eGcNeChFSLimh+J9Na9+4lNdIs6l1LamRfVEA9iBlLalE6lj42z0LMmBLRuCXzSv2IN2vMajVPYL4CxIwpEU1bMq/Uj3izBqvVvh28AWKGym4xy6OsZ682fHJXkIxZ1nhGO2cA+vuwEz4rurqrYTlvzWZ4ZAjS7wg7ewDEDMAKj//ZGQu7905qMLzzegKyIWb8gxQfYWct7GZ41GJ49THinAkxg/KOhqIGOeJd5ySL3IXGjyoRA9My2/eIeiu86p5kkLvQ+FElYnCS2X5HxrN34VH/JIPcg8aPKqePZ2TM9HpTyxGYr0HOQ+NHFa8GerJktjsC80/os3cgGRAzKErIEd6ZljwZTERfzkDMoEQ15Jm7m/WA5fRAzKBkXlTL2MnZPZcMiBmUqAZPc//jBQkQMyiRjV7NXt17+IIEiBmUk6a9B7o6L74lMzEQM6ZYBmAZWH92BbvfWPkPBWLGFv3gNNi9wgzEjCIXEDOKXEDMKHIBMaPIBcSMIhcQM4pcQMwocgExo8gFxIwiF6Vn6PX6AcUYcZuDebiXAAAAAElFTkSuQmCC)
But this does not work in GitHub Markdown engine, for example.