Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async void Save(MemoryStream streams, string filename)

You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PowerPoint-Examples/tree/master/PPTX-to-Markdown-Conversion/Convert-PPTX-to-Markdown).

### Preserving Charts, SmartArt, and Other Elements as Fallback Images
### Preserve Visual Elements as Images

The .NET PowerPoint (Presentation) library preserves PowerPoint elements such as Chart, SmartArt, GroupShape, and OLE Object as fallback images when converting a PowerPoint presentation to a Markdown file. This ensures that content which does not have a direct Markdown equivalent is still retained in the output as an image.

Expand Down Expand Up @@ -151,6 +151,19 @@ using (IPresentation presentation = Presentation.Open("Input.pptx"))
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Open an existing PowerPoint Presentation.
Using presentation As IPresentation = Presentation.Open("Input.pptx")
'Initialize the chart-to-image converter to preserve charts as images.
presentation.ChartToImageConverter = New ChartToImageConverter()

'SmartArt, GroupShape, and OLE Object are preserved automatically on Windows.

'Save the PowerPoint Presentation as a Markdown file.
presentation.Save("Output.md")
End Using
{% endhighlight %}

{% endtabs %}

You can download a complete working sample from GitHub.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ The following table shows the list of Word document elements supported in Word t
</tbody>
</table>

### Preserving Charts, Shapes, and Other Elements as Images
### Preserve Visual Elements as Images

The .NET Word (DocIO) library preserves Word elements such as Chart, Text Box, Shape, Ink, MathML, SmartArt, Canvas, and GroupShape as fallback images when converting a Word document to a Markdown file. This ensures that content which does not have a direct Markdown equivalent is still retained in the output as an image.

Expand Down Expand Up @@ -695,6 +695,19 @@ using (WordDocument wordDocument = new WordDocument("Input.docx", FormatType.Doc
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Open an existing Word document.
Using wordDocument As WordDocument = New WordDocument("Input.docx", FormatType.Docx)
'Initialize the chart-to-image converter to preserve charts as images.
wordDocument.ChartToImageConverter = New ChartToImageConverter()

'Text Box, Shape, Ink, MathML, and SmartArt are preserved automatically on Windows.

'Save the document as a Markdown file.
wordDocument.Save("WordtoMd.md", FormatType.Markdown)
End Using
{% endhighlight %}

{% endtabs %}

You can download a complete working sample from GitHub.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ You can embed the fonts used in a Word document directly into the saved file by
N> Embedding font is supported on both Windows and cross-platform (ASP.NET Core, Blazor, .NET MAUI, and WinUI) environments.
N> For cross-platform applications, install the [Syncfusion.DocIORenderer.Net.Core](https://www.nuget.org/packages/Syncfusion.DocIORenderer.Net.Core) NuGet package.
N> Initialize the `DocIORenderer` to embed fonts in the document.
N> It is supported only for DOCX format document
N> Embedding font is not supported on the UWP platform.

Use the following code to embed fonts before saving the document.
Expand Down Expand Up @@ -1063,6 +1064,17 @@ using (WordDocument document = new WordDocument("Input.docx", FormatType.Docx))
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Load an existing Word document.
Using document As WordDocument = New WordDocument("Input.docx", FormatType.Docx)
'Enable the flag to embed complete TrueType/OpenType fonts used in the document.
document.SaveOptions.EmbedFonts = True
'Save the Word document.
document.Save("Output.docx", FormatType.Docx)
document.Close()
End Using
{% endhighlight %}

{% endtabs %}

You can download a complete working sample from GitHub.
Expand Down