Class MarkdownSaveOptions

Class MarkdownSaveOptions

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.3.0)

Class to specify additional options when saving a document into the Aspose.Words.SaveFormat.Markdown format.

To learn more, visit the Specify Save Options documentation article.

public class MarkdownSaveOptions : TxtSaveOptionsBase

Inheritance

objectSaveOptionsTxtSaveOptionsBaseMarkdownSaveOptions

Inherited Members

TxtSaveOptionsBase.Encoding, TxtSaveOptionsBase.ParagraphBreak, TxtSaveOptionsBase.ForcePageBreaks, TxtSaveOptionsBase.ExportHeadersFootersMode, SaveOptions.CreateSaveOptions(SaveFormat), SaveOptions.CreateSaveOptions(string), SaveOptions.SaveFormat, SaveOptions.ExportGeneratorName, SaveOptions.TempFolder, SaveOptions.PrettyFormat, SaveOptions.UseAntiAliasing, SaveOptions.UseHighQualityRendering, SaveOptions.DmlRenderingMode, SaveOptions.DmlEffectsRenderingMode, SaveOptions.ImlRenderingMode, SaveOptions.DefaultTemplate, SaveOptions.UpdateFields, SaveOptions.UpdateLastSavedTimeProperty, SaveOptions.UpdateLastPrintedProperty, SaveOptions.UpdateCreatedTimeProperty, SaveOptions.MemoryOptimization, SaveOptions.UpdateAmbiguousTextFont, SaveOptions.Dml3DEffectsRenderingMode, SaveOptions.ProgressCallback, SaveOptions.AllowEmbeddingPostScriptFonts, SaveOptions.CustomTimeZoneInfo, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

MarkdownSaveOptions()

Initializes a new instance of this class that can be used to save a document in the Aspose.Words.SaveFormat.Markdown format.

public MarkdownSaveOptions()

Properties

ExportAsHtml

Allows to specify the elements to be exported to Markdown as raw HTML. Default value is Aspose.Words.Saving.MarkdownExportAsHtml.None.

public MarkdownExportAsHtml ExportAsHtml { get; set; }

Property Value

MarkdownExportAsHtml

ExportImagesAsBase64

Specifies whether images are saved in Base64 format to the output file. Default value is false.

public bool ExportImagesAsBase64 { get; set; }

Property Value

bool

Remarks

When this property is set to true images data are exported directly into the img elements and separate files are not created.

ExportUnderlineFormatting

Gets or sets a boolean value indicating either to export underline text formatting as sequence of two plus characters “++”. The default value is false.

public bool ExportUnderlineFormatting { get; set; }

Property Value

bool

ImageResolution

Specifies the output resolution for images when exporting to Markdown. Default is 96 dpi.

public int ImageResolution { get; set; }

Property Value

int

ImageSavingCallback

Allows to control how images are saved when a document is saved to Aspose.Words.SaveFormat.Markdown format.

public IImageSavingCallback ImageSavingCallback { get; set; }

Property Value

IImageSavingCallback

ImagesFolder

Specifies the physical folder where images are saved when exporting a document to the Aspose.Words.SaveFormat.Markdown format. Default is an empty string.

public string ImagesFolder { get; set; }

Property Value

string

Remarks

When you save a Aspose.Words.Document in Aspose.Words.SaveFormat.Markdown format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder allows you to specify where the images will be saved.

If you save a document into a file and provide a file name, Aspose.Words, by default, saves the images in the same folder where the document file is saved. Use Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder to override this behavior.

If you save a document into a stream, Aspose.Words does not have a folder where to save the images, but still needs to save the images somewhere. In this case, you need to specify an accessible folder in the Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder property.

If the folder specified by Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder doesn't exist, it will be created automatically.

ImagesFolderAlias

Specifies the name of the folder used to construct image URIs written into a document. Default is an empty string.

public string ImagesFolderAlias { get; set; }

Property Value

string

Remarks

When you save a Aspose.Words.Document in Aspose.Words.SaveFormat.Markdown format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder allows you to specify where the images will be saved and Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolderAlias allows to specify how the image URIs will be constructed.

If Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolderAlias is not an empty string, then the image URI written to Markdown will be ImagesFolderAlias + <image file name>.

If Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolderAlias is an empty string, then the image URI written to Markdown will be ImagesFolder + <image file name>.

If Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolderAlias is set to '.' (dot), then the image file name will be written to Markdown without path regardless of other options.

Aspose.Words.Saving.MarkdownSaveOptions.ImagesFolder Aspose.Words.Saving.MarkdownSaveOptions.ImageSavingCallback

LinkExportMode

Specifies how links will be written to the output file. Default value is Aspose.Words.Saving.MarkdownLinkExportMode.Auto.

public MarkdownLinkExportMode LinkExportMode { get; set; }

Property Value

MarkdownLinkExportMode

ListExportMode

Specifies how list items will be written to the output file. Default value is Aspose.Words.Saving.MarkdownListExportMode.MarkdownSyntax.

public MarkdownListExportMode ListExportMode { get; set; }

Property Value

MarkdownListExportMode

Remarks

When this property is set to Aspose.Words.Saving.MarkdownListExportMode.PlainText all list labels are updated using Aspose.Words.Document.UpdateListLabels and exported with their actual values. Such lists can be non-compatible with Markdown format and will be recognized as plain text upon importing in this case.

When this property is set to Aspose.Words.Saving.MarkdownListExportMode.MarkdownSyntax, writer tries to export list items in manner that allows to numerate list items in automatic mode by Markdown.

OfficeMathExportMode

Specifies how OfficeMath will be written to the output file. Default value is Aspose.Words.Saving.MarkdownOfficeMathExportMode.Text.

public MarkdownOfficeMathExportMode OfficeMathExportMode { get; set; }

Property Value

MarkdownOfficeMathExportMode

SaveFormat

Specifies the format in which the document will be saved if this save options object is used. Can only be Aspose.Words.SaveFormat.Markdown.

public override SaveFormat SaveFormat { get; set; }

Property Value

SaveFormat

TableContentAlignment

Gets or sets a value that specifies how to align contents in tables when exporting into the Aspose.Words.SaveFormat.Markdown format. The default value is Aspose.Words.Saving.TableContentAlignment.Auto.

public TableContentAlignment TableContentAlignment { get; set; }

Property Value

TableContentAlignment