CustomUriExportStrategy
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.markdown.IUriExportStrategy
public class CustomUriExportStrategy implements IUriExportStrategy
Implements a URI export strategy that lets you customize how resource URIs are written to Markdown.
Supply an IUriSavingHandler implementation to rewrite resource URIs (for example, to prepend a CDN base URL).
Example:
IUriSavingHandler handler = new CdnUriHandler();
ConvertOptions options = new ConvertOptions();
options.setUriExportStrategy(new CustomUriExportStrategy(handler));
String markdown = MarkdownConverter.toMarkdown("document.docx", options);
| Constructor | Description |
|---|---|
| CustomUriExportStrategy(IUriSavingHandler handler) | Initializes a new instance of the CustomUriExportStrategy class. |
| Method | Description |
|---|---|
| updateResourceUri(UriExportContext context) |
public CustomUriExportStrategy(IUriSavingHandler handler)
Initializes a new instance of the CustomUriExportStrategy class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| handler | IUriSavingHandler | the handler that is called for each resource URI during conversion |
public void updateResourceUri(UriExportContext context)
Called for each resource URI that will be written to the Markdown output. Modify properties on context to customize the resulting URI.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| context | UriExportContext |
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.