To know what keys to modify/add, see the accepted answer here:
Add menu item to windows context menu only for specific filetype
To add the keys using C#, use a RegistryKey object
string[] exts = {".pdf", ".doc"};
foreach (string ext in exts)
{
RegistryKey _key = Registry.ClassesRoot.OpenSubKey($"HKEY_CLASSES_ROOT\\{ext}\\shell", true);
RegistryKey newkey = _key.CreateSubKey("Use Virtual Printer");
RegistryKey subNewkey = newkey.CreateSubKey("Command");
subNewkey.SetValue("", "C:\\yourApplication.exe");
subNewkey.Close();
newkey.Close();
_key.Close();
}
modified from How add context menu item to Windows Explorer for folders