.Net Core 5, GroupDocs.Total 22.9
My annoying work around:
if (attachment != null)
{
//Check filetype to enable/disable watermarker
IEnumerable supportedFileTypes = FileType.GetSupportedFileTypes();
string attachmentExtension = Path.GetExtension(attachment.FilePath);
bool useWatermarker = false;
foreach (var fileType in supportedFileTypes)
{
if(fileType.Extension.ToUpper() == attachmentExtension.ToUpper())
{
useWatermarker = true;
break;
}
}
if(attachmentExtension.ToUpper() == ".PDF")
{
useWatermarker = true; //hack since PDF is not returned
}