public static string GetSaveFormat(string format)
{
try
{
string saveOption = SaveFormat.Pdf.ToString();
switch (format)
{
case "Pdf":
saveOption = SaveFormat.Pdf.ToString(); break;
case "Doc":
saveOption = SaveFormat.Doc.ToString(); break;
case "Docx":
saveOption = SaveFormat.Docx.ToString(); break;
case "Odt":
saveOption = SaveFormat.Odt.ToString(); break;
case "Xps":
saveOption = SaveFormat.Xps.ToString(); break;
case "Tiff":
saveOption = SaveFormat.Tiff.ToString(); break;
case "Png":
saveOption = SaveFormat.Png.ToString(); break;
case "Jpeg":
saveOption = SaveFormat.Jpeg.ToString(); break;
// there are many document formats supported, check SaveFormat property for more
}
return saveOption;
}
catch (Exception exc)
{
throw exc;
}
}