private void applyPrintOptionsFromString(string options, ref _WebKitBrowser web)
 {
     PrintOptions po;
     //Get User Params
     po = Newtonsoft.Json.JsonConvert.DeserializeObject<PrintOptions>(options);
     //Converting
     po.marginLeft = mm2inch(po.marginLeft);
     po.marginTop = mm2inch(po.marginTop);
     po.marginRight = mm2inch(po.marginRight);
     po.marginBottom = mm2inch(po.marginBottom);
     //Apply Options
     web.PageSettings.PaperSize = new System.Drawing.Printing.PaperSize("YesPos", mm2inch(po.paperWidth), mm2inch(po.paperHeight));
     web.PageSettings.Margins = new System.Drawing.Printing.Margins(po.marginLeft, po.marginRight, po.marginTop, po.marginBottom);
     web.PageSettings.PrinterSettings.PrinterName = po.printer;
     //Set SystemDefaultPrinter
     var tempDefPinter = get_system_default_printer();
     if (tempDefPinter != po.printer)
     {
         SetDefaultPrinter(po.printer);
     }
 }
 public void print_url(string url, string options)
 {
     Dispatcher.Invoke(F, () =>
     {
         if (String.IsNullOrEmpty(options)) options = get_default_print_options();
         var webTemp = new _WebKitBrowser();
         F.Controls.Add(webTemp);
         webTemp.Navigate(url);
         webTemp.DocumentCompleted += (sender, e) =>
         {
             applyPrintOptionsFromString(options, ref webTemp);
             webTemp.Print();
             F.Controls.Remove(webTemp);
         };
         webTemp.Error += (sender, e) => { F.Controls.Remove(webTemp); };
     });
 }