public string Init(string url) { _url = url; _clear = new Thread(CloseInvalidProcess); _clear.Start(); DocTitle = Guid.NewGuid().ToString("N");//每次打印生成一个GUID _autoResetEvent = new AutoResetEvent(false); var cwi = CefWindowInfo.Create(); _bsClient = new BsClient(this); _bsClient.OnCreated += Bc_OnCreated; var bs = new CefBrowserSettings(); CefBrowserHost.CreateBrowser(cwi, _bsClient, bs, url); _autoResetEvent.WaitOne(); return(Path.Combine(ConfigCst.CurPath, DocTitle + ".pdf")); }
public BsLifeSpanHandler(BsClient bc) { bClient = bc; }