Chromium Embedded Framework (CEF)  129.0.1+g463bda9+chromium-129.0.6668.12
CefPrintHandler Class Referenceabstract

Implement this interface to handle printing on Linux. More...

#include "include/cef_print_handler.h"

Inheritance diagram for CefPrintHandler:
CefBaseRefCounted

Public Member Functions

virtual void OnPrintStart (CefRefPtr< CefBrowser > browser)=0
 Called when printing has started for the specified |browser|. More...
 
virtual void OnPrintSettings (CefRefPtr< CefBrowser > browser, CefRefPtr< CefPrintSettings > settings, bool get_defaults)=0
 Synchronize |settings| with client state. More...
 
virtual bool OnPrintDialog (CefRefPtr< CefBrowser > browser, bool has_selection, CefRefPtr< CefPrintDialogCallback > callback)=0
 Show the print dialog. More...
 
virtual bool OnPrintJob (CefRefPtr< CefBrowser > browser, const CefString &document_name, const CefString &pdf_file_path, CefRefPtr< CefPrintJobCallback > callback)=0
 Send the print job to the printer. More...
 
virtual void OnPrintReset (CefRefPtr< CefBrowser > browser)=0
 Reset client state related to printing. More...
 
virtual CefSize GetPdfPaperSize (CefRefPtr< CefBrowser > browser, int device_units_per_inch)
 Return the PDF paper size in device units. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Implement this interface to handle printing on Linux.

Each browser will have only one print job in progress at a time. The methods of this class will be called on the browser process UI thread.

Member Function Documentation

◆ GetPdfPaperSize()

virtual CefSize CefPrintHandler::GetPdfPaperSize ( CefRefPtr< CefBrowser browser,
int  device_units_per_inch 
)
inlinevirtual

Return the PDF paper size in device units.

Used in combination with CefBrowserHost::PrintToPDF().

◆ OnPrintDialog()

virtual bool CefPrintHandler::OnPrintDialog ( CefRefPtr< CefBrowser browser,
bool  has_selection,
CefRefPtr< CefPrintDialogCallback callback 
)
pure virtual

Show the print dialog.

Execute |callback| once the dialog is dismissed. Return true if the dialog will be displayed or false to cancel the printing immediately.

◆ OnPrintJob()

virtual bool CefPrintHandler::OnPrintJob ( CefRefPtr< CefBrowser browser,
const CefString document_name,
const CefString pdf_file_path,
CefRefPtr< CefPrintJobCallback callback 
)
pure virtual

Send the print job to the printer.

Execute |callback| once the job is completed. Return true if the job will proceed or false to cancel the job immediately.

◆ OnPrintReset()

virtual void CefPrintHandler::OnPrintReset ( CefRefPtr< CefBrowser browser)
pure virtual

Reset client state related to printing.

◆ OnPrintSettings()

virtual void CefPrintHandler::OnPrintSettings ( CefRefPtr< CefBrowser browser,
CefRefPtr< CefPrintSettings settings,
bool  get_defaults 
)
pure virtual

Synchronize |settings| with client state.

If |get_defaults| is true then populate |settings| with the default print settings. Do not keep a reference to |settings| outside of this callback.

◆ OnPrintStart()

virtual void CefPrintHandler::OnPrintStart ( CefRefPtr< CefBrowser browser)
pure virtual

Called when printing has started for the specified |browser|.

This method will be called before the other OnPrint*() methods and irrespective of how printing was initiated (e.g. CefBrowserHost::Print(), JavaScript window.print() or PDF extension print button).


The documentation for this class was generated from the following file: