CustomUriExportStrategy

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);
 

Constructors

Constructor Description
CustomUriExportStrategy(IUriSavingHandler handler) Initializes a new instance of the CustomUriExportStrategy class.

Methods

CustomUriExportStrategy(IUriSavingHandler handler)

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

updateResourceUri(UriExportContext context)

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