Skip to content

Commit d655394

Browse files
committed
addressing review comments
1 parent 7b26c25 commit d655394

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

dotnet/src/webdriver/PrintOptions.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,36 @@ public class PrintOptions
5050
private const double DefaultPageHeight = 21.59;
5151
private const double DefaultPageWidth = 27.94;
5252
private const double CentimetersPerInch = 2.54;
53-
public static PageSize A4 { get; } = new PageSize { Width = 21.0, Height = 29.7 }; // cm
54-
public static PageSize Legal { get; } = new PageSize { Width = 21.59, Height = 35.56 }; // cm
55-
public static PageSize Letter { get; } = new PageSize { Width = 21.59, Height = 27.94 }; // cm
56-
public static PageSize Tabloid { get; } = new PageSize { Width = 27.94, Height = 43.18 }; // cm
5753
private double scale = 1.0;
5854
private PageSize pageSize = new PageSize();
5955
private Margins margins = new Margins();
6056
private readonly HashSet<object> pageRanges = new HashSet<object>();
6157

58+
6259
/// <summary>
63-
/// Initializes a new instance of the <see cref="PrintOptions"/> class with default values.
64-
/// Default page size is set to A4.
60+
/// Represents the A4 paper size.
61+
/// Width: 21.0 cm, Height: 29.7 cm
6562
/// </summary>
66-
public PrintOptions()
67-
{
68-
this.PageDimensions = A4; // Default to A4 page size
69-
}
63+
public static PageSize A4 => new PageSize { Width = 21.0, Height = 29.7 }; // cm
64+
65+
/// <summary>
66+
/// Represents the Legal paper size.
67+
/// Width: 21.59 cm, Height: 35.56 cm
68+
/// </summary>
69+
public static PageSize Legal => new PageSize { Width = 21.59, Height = 35.56 }; // cm
70+
71+
/// <summary>
72+
/// Represents the Letter paper size.
73+
/// Width: 21.59 cm, Height: 27.94 cm
74+
/// </summary>
75+
public static PageSize Letter => new PageSize { Width = 21.59, Height = 27.94 }; // cm
76+
77+
/// <summary>
78+
/// Represents the Tabloid paper size.
79+
/// Width: 27.94 cm, Height: 43.18 cm
80+
/// </summary>
81+
public static PageSize Tabloid => new PageSize { Width = 27.94, Height = 43.18 }; // cm
82+
7083

7184
/// <summary>
7285
/// Gets or sets the orientation of the pages in the printed document.
@@ -77,6 +90,9 @@ public PrintOptions()
7790
/// Gets or sets the amount which the printed content is zoomed. Valid values are 0.1 to 2.0.
7891
/// </summary>
7992
/// <exception cref="ArgumentOutOfRangeException">If the value is not set between 0.1 and 2.0.</exception>
93+
94+
95+
8096
public double ScaleFactor
8197
{
8298
get => this.scale;

0 commit comments

Comments
 (0)