mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Remove IBrowserHost.PrintToPdfAsync - code is now implemented in the PrintToPdfAsync extension method
This commit is contained in:
@@ -72,15 +72,6 @@ void CefBrowserHostWrapper::Print()
|
||||
_browserHost->Print();
|
||||
}
|
||||
|
||||
Task<bool>^ CefBrowserHostWrapper::PrintToPdfAsync(String^ path, PdfPrintSettings^ settings)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
auto printToPdfTask = gcnew TaskPrintToPdfCallback();
|
||||
PrintToPdf(path, settings, printToPdfTask);
|
||||
return printToPdfTask->Task;
|
||||
}
|
||||
|
||||
void CefBrowserHostWrapper::PrintToPdf(String^ path, PdfPrintSettings^ settings, IPrintToPdfCallback^ callback)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace CefSharp
|
||||
public:
|
||||
virtual void StartDownload(String^ url);
|
||||
virtual void Print();
|
||||
virtual Task<bool>^ PrintToPdfAsync(String^ path, PdfPrintSettings^ settings);
|
||||
virtual void PrintToPdf(String^ path, PdfPrintSettings^ settings, IPrintToPdfCallback^ callback);
|
||||
virtual void SetZoomLevel(double zoomLevel);
|
||||
virtual Task<double>^ GetZoomLevelAsync();
|
||||
|
||||
@@ -189,16 +189,6 @@ namespace CefSharp
|
||||
/// </summary>
|
||||
void Print();
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronously prints the current browser contents to the Pdf file specified.
|
||||
/// The caller is responsible for deleting the file when done.
|
||||
/// </summary>
|
||||
/// <param name="path">Output file location.</param>
|
||||
/// <param name="settings">Print Settings.</param>
|
||||
/// <returns>A task that represents the asynchronous print operation.
|
||||
/// The result is true on success or false on failure to generate the Pdf.</returns>
|
||||
Task<bool> PrintToPdfAsync(string path, PdfPrintSettings settings = null);
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronously prints the current browser contents to the Pdf file specified.
|
||||
/// The caller is responsible for deleting the file when done.
|
||||
|
||||
@@ -547,7 +547,10 @@ namespace CefSharp
|
||||
var host = cefBrowser.GetHost();
|
||||
ThrowExceptionIfBrowserHostNull(host);
|
||||
|
||||
return host.PrintToPdfAsync(path, settings);
|
||||
var callback = new TaskPrintToPdfCallback();
|
||||
host.PrintToPdf(path, settings, callback);
|
||||
|
||||
return callback.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user