Search code examples
c#postscriptprinters

Check if printer supports postscript


is there any way to check if printer supports postscript, using C#? I need to check this before I do anything with my document.

Thanks, Bartosz


Solution

  • You could use WMI potentially, however im not sure if this solution will be reliable

    System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT * FROM Win32_Printer");
    ManagementObjectSearcher mos = new ManagementObjectSearcher(oq);
    ManagementObjectCollection moc = mos.Get();
    foreach( ManagementObject mo in moc )
    {
    
        string name = mo["Name"].ToString();
        string language = mo["DefaultLanguage"].ToString();
        MessageBox.Show(String.Format("Printer: {0} -- Language: {1}", name, language));
    }
    

    Lifted from here

    Update

    Check here to see other fields that might be relevant

    Win32_Printer class

    In particular uint16 LanguagesSupported[];