public class MarkdownExportAsHtml
extends java.lang.Object
Examples:
Shows how to export tables that cannot be correctly represented in pure Markdown as raw HTML.
String outputPath = getArtifactsDir() + "MarkdownSaveOptions.NonCompatibleTables.md";
Document doc = new Document(getMyDir() + "Non compatible table.docx");
// With the "NonCompatibleTables" option, you can export tables that have a complex structure with merged cells
// or nested tables to raw HTML and leave simple tables in Markdown format.
MarkdownSaveOptions saveOptions = new MarkdownSaveOptions();
saveOptions.setExportAsHtml(MarkdownExportAsHtml.NON_COMPATIBLE_TABLES);
doc.save(outputPath, saveOptions);
Shows how to export a table to Markdown as raw HTML.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Sample table:");
// Create table.
builder.insertCell();
builder.getParagraphFormat().setAlignment(ParagraphAlignment.RIGHT);
builder.write("Cell1");
builder.insertCell();
builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
builder.write("Cell2");
MarkdownSaveOptions saveOptions = new MarkdownSaveOptions();
saveOptions.setExportAsHtml(MarkdownExportAsHtml.TABLES);
doc.save(getArtifactsDir() + "MarkdownSaveOptions.ExportTableAsHtml.md", saveOptions);
| Modifier and Type | Field and Description |
|---|---|
static int |
length |
static int |
NON_COMPATIBLE_TABLES
Export tables that cannot be correctly represented in pure Markdown as raw HTML.
|
static int |
NONE
Export all elements using Markdown syntax without any raw HTML.
|
static int |
TABLES
Export tables as raw HTML.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String markdownExportAsHtmlName) |
static int |
fromNames(java.util.Set markdownExportAsHtmlNames) |
static java.lang.String |
getName(int markdownExportAsHtml) |
static java.util.Set |
getNames(int markdownExportAsHtml) |
static int[] |
getValues() |
static java.lang.String |
toString(int markdownExportAsHtml) |
static java.lang.String |
toStringSet(int attr) |
public static int NONE
public static int TABLES
Remarks:
When this option is enabled, every table will be exported as raw HTML. Aspose.Words will try to preserve all formatting of the tables in this case.
If this flag is set, then related NON_COMPATIBLE_TABLES flag will be ignored.
public static int NON_COMPATIBLE_TABLES
Remarks:
When this option is enabled, Aspose.Words will only export tables that have merged cells or nested tables as raw HTML. And all other tables will be exported in Markdown format. Also note, this option will not preserve all formatting of the table, but only preserves corresponding spans of the cells.
If related TABLES flag is set, then this flag will be ignored.
public static int length
public static java.lang.String getName(int markdownExportAsHtml)
public static java.util.Set getNames(int markdownExportAsHtml)
public static java.lang.String toString(int markdownExportAsHtml)
public static java.lang.String toStringSet(int attr)
public static int fromName(java.lang.String markdownExportAsHtmlName)
public static int fromNames(java.util.Set markdownExportAsHtmlNames)
public static int[] getValues()