We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Watermarker GetSupportedFileTypes() does not include .PDF (but it works on PDF)

.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;
            if(attachmentExtension.ToUpper() == ".PDF")
                useWatermarker = true; //hack since PDF is not returned
1 Like


Please take a look at this screenshot.png (7.6 KB). It successfully includes .PDF.
Please share the problematic PDF and a sample application using that issue could be reproduced at our end.

Issue turned out to be a conflicting package, referencing Viewer instead of watermarker for supported file types. This can be closed.