public void printToPDF(string path, CefPdfPrintSettings settings, CefPdfPrintCallback callback) { var _context = CefV8Context.GetCurrentContext(); if (_context != null) { var _browser = _context.GetBrowser(); if (_browser != null) { var _host = _browser.GetHost(); if (_host != null) { _host.PrintToPdf(path, settings, callback); } } } }
/// <summary> /// Print the current browser contents to the PDF file specified by |path| and /// execute |callback| on completion. The caller is responsible for deleting /// |path| when done. For PDF printing to work on Linux you must implement the /// CefPrintHandler::GetPdfPaperSize method. /// </summary> public void PrintToPdf(string path, CefPdfPrintSettings settings, CefPdfPrintCallback callback) { BrowserHost?.PrintToPdf(path, settings, callback); }