Convert specific pages
Leave feedback
GroupDocs.Markdown also provides the feature to convert selected page number.
To convert specific pages, follow these steps:
- Create an instance of MarkdownConverter class and pass source document path as a constructor parameter.
- Instantiate the appropriate DocumentConverterOptions class.
- Set the PageNumbers property of the DocumentConverterOptions instance to the list of desired page number to be converted.
- Call the Convert method of MarkdownConverter class instance and pass the filename of the converted document and the instance of DocumentConverterOptions from the previous steps.
The following code snippet shows how to convert first and third pages from the source document:
using (var converter = new MarkdownConverter("sample.docx"))
{
var options = new DocumentConverterOptions
{
PageNumbers = new []{ 1, 3 }
};
converter.Convert("output.md", options);
}
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.