MarkdownConverter
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.AutoCloseable
public class MarkdownConverter implements AutoCloseable
Converts documents from Word, Excel, PDF, and other formats to Markdown. Provides both static one-liner methods and an instance-based API with full control over conversion options.
public MarkdownConverter(String sourcePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String |
public MarkdownConverter(InputStream sourceStream)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourceStream | java.io.InputStream |
public MarkdownConverter(String sourcePath, LoadOptions sourceLoadOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| sourceLoadOptions | LoadOptions |
public MarkdownConverter(InputStream sourceStream, LoadOptions sourceLoadOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourceStream | java.io.InputStream | |
| sourceLoadOptions | LoadOptions |
public DocumentConvertResult convert()
Returns: DocumentConvertResult
public DocumentConvertResult convert(OutputStream outputStream)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| outputStream | java.io.OutputStream |
Returns: DocumentConvertResult
public DocumentConvertResult convert(String outputFilePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| outputFilePath | java.lang.String |
Returns: DocumentConvertResult
public DocumentConvertResult convert(DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| convertOptions | DocumentConvertOptions |
Returns: DocumentConvertResult
public DocumentConvertResult convert(OutputStream outputStream, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| outputStream | java.io.OutputStream | |
| convertOptions | DocumentConvertOptions |
Returns: DocumentConvertResult
public DocumentConvertResult convert(String outputFilePath, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| outputFilePath | java.lang.String | |
| convertOptions | DocumentConvertOptions |
Returns: DocumentConvertResult
public DocumentInfo getDocumentInfo()
Returns: DocumentInfo
public static String toMarkdown(String sourcePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String |
Returns: java.lang.String
public static String toMarkdown(String sourcePath, LoadOptions loadOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| loadOptions | LoadOptions |
Returns: java.lang.String
public static String toMarkdown(String sourcePath, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| convertOptions | DocumentConvertOptions |
Returns: java.lang.String
public static String toMarkdown(String sourcePath, LoadOptions loadOptions, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| loadOptions | LoadOptions | |
| convertOptions | DocumentConvertOptions |
Returns: java.lang.String
public static void toFile(String sourcePath, String outputPath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| outputPath | java.lang.String |
public static void toFile(String sourcePath, String outputPath, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| outputPath | java.lang.String | |
| convertOptions | DocumentConvertOptions |
toFile(String sourcePath, String outputPath, LoadOptions loadOptions, DocumentConvertOptions convertOptions)
public static void toFile(String sourcePath, String outputPath, LoadOptions loadOptions, DocumentConvertOptions convertOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| outputPath | java.lang.String | |
| loadOptions | LoadOptions | |
| convertOptions | DocumentConvertOptions |
public static DocumentInfo getInfo(String sourcePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String |
Returns: DocumentInfo
public static DocumentInfo getInfo(String sourcePath, LoadOptions loadOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | java.lang.String | |
| loadOptions | LoadOptions |
Returns: DocumentInfo
public static List<FileFormat> getSupportedFormats()
Returns: java.util.List<com.groupdocs.markdown.FileFormat>
public static void fromMarkdown(String markdownPath, String outputPath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| markdownPath | java.lang.String | |
| outputPath | java.lang.String |
public static void fromMarkdown(String markdownPath, String outputPath, ExportOptions options)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| markdownPath | java.lang.String | |
| outputPath | java.lang.String | |
| options | ExportOptions |
public static void fromMarkdownString(String markdownContent, String outputPath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| markdownContent | java.lang.String | |
| outputPath | java.lang.String |
public static void fromMarkdownString(String markdownContent, String outputPath, ExportOptions options)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| markdownContent | java.lang.String | |
| outputPath | java.lang.String | |
| options | ExportOptions |
public static void fromMarkdownString(String markdownContent, OutputStream outputStream, ExportOptions options)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| markdownContent | java.lang.String | |
| outputStream | java.io.OutputStream | |
| options | ExportOptions |
public void close()
public static byte[] readAllBytes(InputStream inputStream)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| inputStream | java.io.InputStream |
Returns: byte[]
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.