Get default ConvertOptions for specific target format
Leave feedback
GroupDocs.Conversion allows to get default convert options for specific target format by following the below steps:
- Create new instance of Converter class by passing source document path as constructor’s parameter
- Call GetPossibleConversions method of converter object
- Use the file extension or
FileType
as key to indexer of object received as value in previous step
The following code snippet shows how to get possible conversions of the source document:
using (var converter = new Converter("source.docx"))
{
var possibleConversions = converter.GetPossibleConversions();
var targetConversion = possibleConversions["pdf"];
var convertOptions = targetConversion?.ConvertOptions;
if (convertOptions != null)
{
converter.Convert("converted.pdf", convertOptions);
}
}
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.