How do I programmatically change printer settings with the WebBrowser control?

后端 未结 4 891
忘掉有多难
忘掉有多难 2020-11-29 06:59

I finally figured out how to print transformed XML without prompting the user or showing an IE window, but now I need to specify a number of copies and possibly other printe

4条回答
  •  一整个雨季
    2020-11-29 07:33

                string strKey = "Software\\Microsoft\\Internet Explorer\\PageSetup";
            bool bolWritable = true;
    
            RegistryKey oKey = Registry.CurrentUser.OpenSubKey(strKey, bolWritable);
            Console.Write(strKey);
    
            if (stringToPrint.Contains("Nalog%20za%20sluzbeno%20putovanje_files"))
            {
                oKey.SetValue("margin_bottom", 15);
                oKey.SetValue("margin_top", 0.19);
            }
            else
            {
                //Return onld walue
                oKey.SetValue("margin_bottom", 0.75);
                oKey.SetValue("margin_top", 0.75);
            }
    

提交回复
热议问题