Chromium Embedded Framework (CEF)  115.2.0+g096e3eb+chromium-115.0.5790.13
cef_pdf_print_settings_t Struct Reference

Structure representing PDF print settings. More...

#include "include/internal/cef_types.h"

Public Attributes

int landscape
 Set to true (1) for landscape mode or false (0) for portrait mode. More...
 
int print_background
 Set to true (1) to print background graphics. More...
 
double scale
 The percentage to scale the PDF by before printing (e.g. More...
 
double paper_width
 Output paper size in inches. More...
 
double paper_height
 
int prefer_css_page_size
 Set to true (1) to prefer page size as defined by css. More...
 
cef_pdf_print_margin_type_t margin_type
 Margin type. More...
 
double margin_top
 Margins in inches. More...
 
double margin_right
 
double margin_bottom
 
double margin_left
 
cef_string_t page_ranges
 Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. More...
 
int display_header_footer
 Set to true (1) to display the header and/or footer. More...
 
cef_string_t header_template
 HTML template for the print header. More...
 
cef_string_t footer_template
 HTML template for the print footer. More...
 

Detailed Description

Structure representing PDF print settings.

These values match the parameters supported by the DevTools Page.printToPDF function. See https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF

Member Data Documentation

◆ display_header_footer

int cef_pdf_print_settings_t::display_header_footer

Set to true (1) to display the header and/or footer.

Modify |header_template| and/or |footer_template| to customize the display.

◆ footer_template

cef_string_t cef_pdf_print_settings_t::footer_template

HTML template for the print footer.

Only displayed if |display_header_footer| is true (1). Uses the same format as |header_template|.

◆ header_template

cef_string_t cef_pdf_print_settings_t::header_template

HTML template for the print header.

Only displayed if |display_header_footer| is true (1). Should be valid HTML markup with the following classes used to inject printing values into them:

  • date: formatted print date
  • title: document title
  • url: document location
  • pageNumber: current page number
  • totalPages: total pages in the document

For example, "<span class=title></span>" would generate a span containing the title.

◆ landscape

int cef_pdf_print_settings_t::landscape

Set to true (1) for landscape mode or false (0) for portrait mode.

◆ margin_bottom

double cef_pdf_print_settings_t::margin_bottom

◆ margin_left

double cef_pdf_print_settings_t::margin_left

◆ margin_right

double cef_pdf_print_settings_t::margin_right

◆ margin_top

double cef_pdf_print_settings_t::margin_top

Margins in inches.

Only used if |margin_type| is set to PDF_PRINT_MARGIN_CUSTOM.

◆ margin_type

cef_pdf_print_margin_type_t cef_pdf_print_settings_t::margin_type

Margin type.

◆ page_ranges

cef_string_t cef_pdf_print_settings_t::page_ranges

Paper ranges to print, one based, e.g., '1-5, 8, 11-13'.

Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end.

◆ paper_height

double cef_pdf_print_settings_t::paper_height

◆ paper_width

double cef_pdf_print_settings_t::paper_width

Output paper size in inches.

If either of these values is less than or equal to zero then the default paper size (letter, 8.5 x 11 inches) will be used.

◆ prefer_css_page_size

int cef_pdf_print_settings_t::prefer_css_page_size

Set to true (1) to prefer page size as defined by css.

Defaults to false (0), in which case the content will be scaled to fit the paper size.

◆ print_background

int cef_pdf_print_settings_t::print_background

Set to true (1) to print background graphics.

◆ scale

double cef_pdf_print_settings_t::scale

The percentage to scale the PDF by before printing (e.g.

.5 is 50%). If this value is less than or equal to zero the default value of 1.0 will be used.


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