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
24 changes: 18 additions & 6 deletions Document-Processing/Markdown/Conversions/html-conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Markdown to HTML and HTML to Markdown Conversions

Markdown is a lightweight markup language that adds formatting elements to plain text documents. The Syncfusion<sup>&reg;</sup> .NET Word (DocIO) library supports converting Markdown to an HTML document and vice versa.
Markdown is a lightweight markup language that adds formatting elements to plain text documents. The Syncfusion<sup>&reg;</sup> [.NET Word (DocIO) library](https://www.syncfusion.com/document-sdk/net-word-library) supports converting Markdown to an HTML document and vice versa.

## Assemblies and NuGet packages required

Expand All @@ -19,7 +19,7 @@ Refer to the following links for the assemblies and NuGet packages required, bas

## Convert Markdown to HTML

Convert an existing markdown file to a HTML document using the .NET Word library.
Convert an existing markdown file to a HTML document using the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library).

The following code example shows how to convert Markdown to HTML document.

Expand Down Expand Up @@ -55,13 +55,15 @@ End Using

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Convert-Markdown-to-HTML/.NET).

## Load Options

When opening an existing Markdown document, the .NET Word library provides custom import settings through the **MdImportSettings** class. This allows you to customize how the Markdown content is parsed and imported.
When opening an existing Markdown document, the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides custom import settings through the **MdImportSettings** class. This allows you to customize how the Markdown content is parsed and imported.

### Customize image data

The .NET Word library provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event.
The [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event.

The following code example shows how to load image data based on the image source path when importing the Markdown files.

Expand Down Expand Up @@ -172,11 +174,13 @@ End Sub

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Customize-image-data/.NET).

N> Hook the event handler before opening a Markdown document as shown in the above code example.

### Encoding

The .NET Word library provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, ASCII, or other encodings.
The [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, ASCII, or other encodings.

The following code example shows how to open a Markdown file with a specific encoding.

Expand Down Expand Up @@ -220,11 +224,13 @@ document.Close()

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Load-Options-Encoding/.NET).

N> Provide the encoding values before opening a Markdown document as per the above code example.

## Convert HTML to Markdown

Convert an existing HTML file to a Markdown document using the .NET Word library.
Convert an existing HTML file to a Markdown document using the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library).

The following code example shows how to convert HTML to Markdown document.

Expand Down Expand Up @@ -258,6 +264,8 @@ End Using

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Convert-HTML-to-Markdown/.NET).

## Save Options

When converting an HTML document to Markdown, the .NET Word (DocIO) library provides various save options to customize the output Markdown file. These options allow you to customize image paths, set character encoding, and other export behaviors.
Expand Down Expand Up @@ -304,6 +312,8 @@ End Using

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Customize-image/.NET).

The following code examples show the event handler to customize the image path and save the image in an external folder.

{% tabs %}
Expand Down Expand Up @@ -390,4 +400,6 @@ End Using

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/HTML-conversions/Save-Options-Encoding/.NET).

N> Set the encoding value before saving the document as per the above code example.
18 changes: 12 additions & 6 deletions Document-Processing/Markdown/Conversions/markdown-to-pdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ documentation: UG

# Markdown to PDF Conversion

Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to a PDF document.
Markdown is a lightweight markup language that adds formatting elements to plain text documents. The [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) supports the conversion of Markdown to a PDF document.

## Assemblies and NuGet packages required

Refer to the following links for assemblies and NuGet packages required based on platforms to convert a Markdown file to a PDF document using the .NET Word Library.
Refer to the following links for assemblies and NuGet packages required based on platforms to convert a Markdown file to a PDF document using the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library).

* [Markdown to PDF assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required)
* [Markdown to PDF NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required)

## Convert Markdown to PDF

Convert an existing markdown file to a PDF document using the .NET Word library.
Convert an existing markdown file to a PDF document using the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library).

The following code example shows how to convert a Markdown file to a PDF document.

Expand Down Expand Up @@ -80,13 +80,15 @@ End Using

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Markdown-to-PDF-conversion/Convert-Markdown-to-PDF/.NET).

## Load Options

When opening an existing Markdown document, the .NET Word library provides custom import settings through the **MdImportSettings** class. This allows you to customize how the Markdown content is parsed and imported before converting to PDF.
When opening an existing Markdown document, the [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides custom import settings through the **MdImportSettings** class. This allows you to customize how the Markdown content is parsed and imported before converting to PDF.

### Customize image data

The .NET Word library provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event.
The [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event.

The following code example shows how to load image data based on the image source path when importing the Markdown file.

Expand Down Expand Up @@ -222,11 +224,13 @@ End Sub

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Markdown-to-PDF-conversion/Customize-image-data/.NET).

N> Hook the event handler before opening a Markdown document as per the above code example.

### Encoding

The .NET Word library provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, ASCII, or other encodings.
The [.NET Word library](https://www.syncfusion.com/document-sdk/net-word-library) provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, ASCII, or other encodings.

The following code example shows how to open a Markdown file with a specific encoding.

Expand Down Expand Up @@ -295,4 +299,6 @@ document.Close()

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Markdown-to-PDF-conversion/Load-Options-Encoding/.NET).

N> Provide the encoding values before opening a Markdown document as per the above code example.
2 changes: 1 addition & 1 deletion Document-Processing/Markdown/Conversions/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ documentation: UG

{% enddoccards %}

The .NET Markdown Conversion Library converts Markdown documents to several file formats like Word, PDF, HTML, PowerPoint, and Excel without external dependencies. It also supports converting Word, PowerPoint, HTML, and Excel to Markdown format. It eases the developers, as they can just integrate this converter to achieve the required Markdown document conversions and concentrate on core logics of their application.
The [.NET Markdown Conversion Library](https://www.syncfusion.com/document-sdk/net-markdown-library) converts Markdown documents to several file formats like Word, PDF, HTML, PowerPoint, and Excel without external dependencies. It also supports converting Word, PowerPoint, HTML, and Excel to Markdown format. It eases the developers, as they can just integrate this converter to achieve the required Markdown document conversions and concentrate on core logics of their application.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Create Markdown document in ASP.NET Core

Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a `.NET Core Markdown library` used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in ASP.NET Core**.
Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in ASP.NET Core**.

## Prerequisites

Expand Down Expand Up @@ -156,3 +156,5 @@ N> The code sample references an image file (`photo.jpg`). Download this asset f
By executing the program, you will get the **Markdown document** as follows.

![ASP.Net Core output Markdown document](GettingStarted_images/GettingStarted_Output1.png)

N> Looking for the full .NET Markdown Library overview, features, pricing, and documentation? Visit the [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) page.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Create Markdown document in ASP.NET MVC

Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a `.NET Markdown library` used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in ASP.NET MVC**.
Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in ASP.NET MVC**.

## Steps to create Markdown document programmatically

Expand Down Expand Up @@ -159,4 +159,6 @@ N> The code sample references an image file (`photo.jpg`). Download this asset f

By executing the program, you will get the Markdown document as follows.

![ASP.Net MVC output Markdown document](GettingStarted_images/GettingStarted_Output1.png)
![ASP.Net MVC output Markdown document](GettingStarted_images/GettingStarted_Output1.png)

N> Looking for the full .NET Markdown Library overview, features, pricing, and documentation? Visit the [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) page.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Create Markdown Document in Blazor

Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a `.NET Markdown library` used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in Blazor**.
Syncfusion<sup>&reg;</sup> Essential<sup>&reg;</sup> Markdown is a [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) used to create, read, and edit **Markdown** documents programmatically without external dependencies. Using this library, you can **create a Markdown document in Blazor**.

## Blazor Web App (Server)

Expand Down Expand Up @@ -518,3 +518,4 @@ By executing the program, you will get the **Markdown document** as follows.

N> While the Markdown library functions in WASM Standalone, server-side deployment is recommended. Running the Markdown library client-side in WASM Standalone increases the application payload size because the library assemblies are downloaded to the browser.

N> Looking for the full .NET Markdown Library overview, features, pricing, and documentation? Visit the [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) page.
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,5 @@ A complete working sample is available on [GitHub](https://github.com/Syncfusion
The resultant Markdown document looks as follows.

![Creating a new Word document from scratch with basic elements](GettingStarted_images/GettingStarted_Output1.png)

N> Looking for the full .NET Markdown Library overview, features, pricing, and documentation? Visit the [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) page.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Loading and Saving a Markdown Document

The Syncfusion<sup>&reg;</sup> .NET Markdown library allows you to load an existing Markdown document and save it to the file system or stream programmatically.
The Syncfusion<sup>&reg;</sup> [.NET Markdown library](https://www.syncfusion.com/document-sdk/net-markdown-library) allows you to load an existing Markdown document and save it to the file system or stream programmatically.

## Namespaces required

Expand Down Expand Up @@ -266,6 +266,81 @@ End Sub

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Read-and-Save-document/Customize-open-markdown-document/.NET).

The following code example demonstrates how to open a Markdown document with a specified encoding.

{% tabs %}

{% highlight c# tabtitle="C#" %}

// Creates a new MarkdownDocument instance.
MarkdownDocument markdownDocument = new MarkdownDocument();
// Creates import settings and specifies the encoding.
MdImportSettings mdImportSettings = new MdImportSettings();
mdImportSettings.Encoding = Encoding.Unicode;
// Opens an existing Markdown document with import settings.
markdownDocument.Open("Input.md", mdImportSettings);
// Saves the Markdown document to the file system.
markdownDocument.Save("Output.md");
// Disposes the document to release all memory.
markdownDocument.Dispose();

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET" %}

' Creates a new MarkdownDocument instance.
Dim markdownDocument As New MarkdownDocument()

' Creates import settings and specifies the encoding.
Dim mdImportSettings As New MdImportSettings()
mdImportSettings.Encoding = Encoding.Unicode
' Opens an existing Markdown document with import settings.
markdownDocument.Open("Input.md", mdImportSettings)
' Saves the Markdown document to the file system.
markdownDocument.Save("Output.md")
' Disposes the document to release all memory.
markdownDocument.Dispose()

{% endhighlight %}

{% endtabs %}

You can also use the constructor approach with import settings.

{% tabs %}

{% highlight c# tabtitle="C#" %}

// Creates import settings and specifies the encoding.
MdImportSettings mdImportSettings = new MdImportSettings();
mdImportSettings.Encoding = Encoding.Unicode;
// Opens an existing Markdown document using constructor.
MarkdownDocument markdownDocument = new MarkdownDocument("Input.md", mdImportSettings);
// Saves the Markdown document to the file system.
markdownDocument.Save("Output.md");
// Disposes the document to release all memory.
markdownDocument.Dispose();

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET" %}

' Creates import settings and specifies the encoding.
Dim mdImportSettings As New MdImportSettings()
mdImportSettings.Encoding = Encoding.Unicode
' Opens an existing Markdown document using constructor.
Dim markdownDocument As New MarkdownDocument("Input.md", mdImportSettings)
' Saves the Markdown document to the file system.
markdownDocument.Save("Output.md")
' Disposes the document to release all memory.
markdownDocument.Dispose()

{% endhighlight %}

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Read-and-Save-document/Load-Options-Encoding/.NET).

## Saving a Markdown Document

You can save the created or manipulated Markdown document to file system or stream using `Save` method of `MarkdownDocument` class.
Expand Down Expand Up @@ -443,6 +518,44 @@ End Sub

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Read-and-Save-document/Customize-save-markdown-conversion/.NET).

The following code example demonstrates how to save a Markdown document with a specified encoding.

{% tabs %}

{% highlight c# tabtitle="C#" %}

// Opens an existing Markdown document.
MarkdownDocument markdownDocument = new MarkdownDocument("Input.md");
// Creates a SaveOptions instance.
SaveOptions saveOptions = new SaveOptions();
// Sets the encoding to use when saving the Markdown document.
saveOptions.Encoding = Encoding.Unicode;
// Saves the Markdown document with the specified encoding.
markdownDocument.Save("Output.md", saveOptions);
// Disposes the document to release all memory.
markdownDocument.Dispose();

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET" %}

' Opens an existing Markdown document.
Dim markdownDocument As MarkdownDocument = New MarkdownDocument("Input.md")
' Creates a SaveOptions instance.
Dim saveOptions As SaveOptions = New SaveOptions()
' Sets the encoding to use when saving the Markdown document.
saveOptions.Encoding = Encoding.Unicode
' Saves the Markdown document with the specified encoding.
markdownDocument.Save("Output.md", saveOptions)
' Disposes the document to release all memory.
markdownDocument.Dispose()

{% endhighlight %}

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Read-and-Save-document/Save-Options-Encoding/.NET).

### Getting Markdown document text

You can retrieve the Markdown document content as a string using the **GetMarkdownText** method. This is useful when you want to get the Markdown content without saving it to a file or stream.
Expand Down
Loading