mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add PDF printing support (issue #1478).
This commit is contained in:
committed by
Marshall Greenblatt
parent
b6e5310bce
commit
85f83680d7
@@ -230,6 +230,27 @@ typedef struct _cef_navigation_entry_visitor_t {
|
||||
} cef_navigation_entry_visitor_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_pdf_print_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed when the PDF printing has completed. |path| is
|
||||
// the output path. |ok| will be true (1) if the printing completed
|
||||
// successfully or false (0) otherwise.
|
||||
///
|
||||
void (CEF_CALLBACK *on_pdf_print_finished)(
|
||||
struct _cef_pdf_print_callback_t* self, const cef_string_t* path,
|
||||
int ok);
|
||||
} cef_pdf_print_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent the browser process aspects of a browser window.
|
||||
// The functions of this structure can only be called in the browser process.
|
||||
@@ -346,6 +367,17 @@ typedef struct _cef_browser_host_t {
|
||||
///
|
||||
void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// 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
|
||||
// cef_print_handler_t::GetPdfPaperSize function.
|
||||
///
|
||||
void (CEF_CALLBACK *print_to_pdf)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* path,
|
||||
const struct _cef_pdf_print_settings_t* settings,
|
||||
struct _cef_pdf_print_callback_t* callback);
|
||||
|
||||
///
|
||||
// Search for |searchText|. |identifier| can be used to have multiple searches
|
||||
// running simultaniously. |forward| indicates whether to search forward or
|
||||
|
Reference in New Issue
Block a user