Hi, I’m using C# to automate LibreOffice to convert documents into PDFs via the export filters. Is there a nice programmatic way to assign the export filter to a particular file type extensions? Currently my code looks like this:
switch (extension)
{
case ".doc":
case ".docx":
case ".txt":
case ".rtf":
case ".html":
case ".htm":
case ".xml":
case ".odt":
case ".wps":
case ".wpd":
case ".lwp":
return "writer_pdf_Export";
case ".xls":
case ".xlsb":
case ".xlsx":
case ".ods":
return "calc_pdf_Export";
case ".ppt":
case ".pptx":
case ".odp":
return "impress_pdf_Export";
default:
return null;
}
Obviously LibreOffice supports much more file extension than that, but was wondering if there a way to extract it via code, rather than “hard coding” with a switch statement like this.