Package org.cef.misc
Class CefPdfPrintSettings
- java.lang.Object
-
- org.cef.misc.CefPdfPrintSettings
-
public class CefPdfPrintSettings extends java.lang.ObjectPDF print settings for browser.printToPDF()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCefPdfPrintSettings.MarginType
-
Field Summary
Fields Modifier and Type Field Description booleandisplay_header_footerSet to true to print headers and footers or false to not print headers and footers.java.lang.Stringfooter_templateHTML template for the print footer.java.lang.Stringheader_templateHTML template for the print header.booleanlandscapeSet to true for landscape mode or false for portrait mode.doublemargin_bottomdoublemargin_leftdoublemargin_rightdoublemargin_topMargins in inches.CefPdfPrintSettings.MarginTypemargin_typeMargin type.java.lang.Stringpage_rangesPaper ranges to print, one based, e.g., '1-5, 8, 11-13'.doublepaper_heightdoublepaper_widthOutput paper size in inches.booleanprefer_css_page_sizeSet to true to prefer page size as defined by css.booleanprint_backgroundSet to true to print background graphics or false to not print background graphics.doublescaleThe percentage to scale the PDF by before printing (e.g.
-
Constructor Summary
Constructors Constructor Description CefPdfPrintSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CefPdfPrintSettingsclone()
-
-
-
Field Detail
-
landscape
public boolean landscape
Set to true for landscape mode or false for portrait mode.
-
print_background
public boolean print_background
Set to true to print background graphics or false to not print background graphics.
-
scale
public double 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.
-
paper_width
public double 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.
-
paper_height
public double paper_height
-
prefer_css_page_size
public boolean prefer_css_page_size
Set to true to prefer page size as defined by css. Defaults to false in which case the content will be scaled to fit the paper size.
-
margin_type
public CefPdfPrintSettings.MarginType margin_type
Margin type.
-
margin_top
public double margin_top
Margins in inches. Only used if margin_type is set to CUSTOM.
-
margin_right
public double margin_right
-
margin_bottom
public double margin_bottom
-
margin_left
public double margin_left
-
page_ranges
public java.lang.String 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.
-
display_header_footer
public boolean display_header_footer
Set to true to print headers and footers or false to not print headers and footers. Modify header_template and/or footer_template to customize the display.
-
header_template
public java.lang.String 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, "" would generate a span containing the title.
-
footer_template
public java.lang.String footer_template
HTML template for the print footer. Only displayed if |display_header_footer| is true (1). Uses the same format as |header_template|.
-
-
Method Detail
-
clone
public CefPdfPrintSettings clone()
- Overrides:
clonein classjava.lang.Object
-
-