况洋洋
2025-07-04 0d247bd2a17e0f99f3609774a1ce54ae00857997
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
 
using System;
 
namespace CefSharp
{
    /// <summary>
    /// Print to Pdf Settings
    /// </summary>
    public sealed class PdfPrintSettings
    {
        /// <summary>
        /// Set to true for landscape mode or false for portrait mode.
        /// </summary>
        public bool Landscape { get; set; }
 
        /// <summary>
        /// Set to true to print background graphics or false to not print
        /// background graphics.
        /// </summary>
        public bool PrintBackground { get; set; }
 
        /// <summary>
        /// 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.
        /// </summary>
        public double Scale { get; set; } = 1.0;
 
        /// <summary>
        /// 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.
        /// </summary>
        public double PaperWidth { get; set; }
 
        /// <summary>
        /// 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.
        /// </summary>
        public double PaperHeight { get; set; }
 
        /// <summary>
        /// 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.
        /// </summary>
        public bool PreferCssPageSize { get; set; }
 
        /// <summary>
        /// Margin type.
        /// </summary>
        public CefPdfPrintMarginType MarginType { get; set; }
 
        /// <summary>
        /// Margins in inches. Only used if <see cref="MarginType"/> is set to
        /// <see cref="CefPdfPrintMarginType.Custom"/>.
        /// </summary>
        public double MarginLeft { get; set; }
 
        /// <summary>
        /// Margins in inches. Only used if <see cref="MarginType"/> is set to
        /// <see cref="CefPdfPrintMarginType.Custom"/>.
        /// </summary>
        public double MarginTop { get; set; }
 
        /// <summary>
        /// Margins in inches. Only used if <see cref="MarginType"/> is set to
        /// <see cref="CefPdfPrintMarginType.Custom"/>.
        /// </summary>
        public double MarginRight { get; set; }
 
        /// <summary>
        /// Margins in inches. Only used if <see cref="MarginType"/> is set to
        /// <see cref="CefPdfPrintMarginType.Custom"/>.
        /// </summary>
        public double MarginBottom { get; set; }
 
        /// <summary>
        /// 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.
        /// </summary>
        public string PageRanges { get; set; }
 
        /// <summary>
        /// Set to true  to display the header and/or footer. Modify
        /// |header_template| and/or |footer_template| to customize the display.
        /// </summary>
        public bool DisplayHeaderFooter { get; set; }
 
        /// <summary>
        /// HTML template for the print header. Only displayed if
        /// <see cref="DisplayHeaderFooter"/> is true. 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, "&lt;span class=title&gt;&lt;/span&gt;" would generate a span containing
        /// the title.
        /// </summary>
        public string HeaderTemplate { get; set; }
 
        /// <summary>
        /// HTML template for the print footer. Only displayed if
        /// <see cref="DisplayHeaderFooter"/> is true. 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, "&lt;span class=title&gt;&lt;/span&gt;" would generate a span containing
        /// the title.
        /// </summary>
        public string FooterTemplate { get; set; }
 
        // Obsolete properties
 
        /// <summary>
        /// Set to true to print background graphics or false to not print
        /// background graphics.
        /// </summary>
        [Obsolete("Use PrintBackground instead")]
        public bool BackgroundsEnabled
        {
            get { return PrintBackground; }
            set { PrintBackground = value; }
        }
 
        /// <summary>
        /// Set to true to print headers and footers or false to not print
        /// headers and footers.
        /// </summary>
        [Obsolete("Use DisplayHeaderFooter instead")]
        public bool HeaderFooterEnabled
        {
            get { return DisplayHeaderFooter; }
            set { DisplayHeaderFooter = value; }
        }
    }
}