Skip to content

Commit 7caf3fd

Browse files
committed
Merge pull request #34 from tomdenny/master
Add support for PageSize setting
2 parents 0460ccc + 21babf8 commit 7caf3fd

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

WkHtmlToXSharp/PdfGlobalSettings.cs

+32-1
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,50 @@ public enum PdfOrientation {
3636
Landscape
3737
}
3838

39+
public enum PdfPageSize
40+
{
41+
A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5, A6, A7,
42+
A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E,
43+
Comm10E, DLE, Folio, Ledger, Tabloid, Custom
44+
}
45+
46+
public class PdfSize
47+
{
48+
/// <summary>
49+
/// What size paper should we use
50+
/// </summary>
51+
public PdfPageSize PageSize { get; set; }
52+
}
53+
3954
public class PdfGlobalSettings
4055
{
41-
private PdfMarginSettings _margins = new PdfMarginSettings();
56+
private readonly PdfMarginSettings _margins = new PdfMarginSettings();
57+
private readonly PdfSize _size = new PdfSize()
58+
{
59+
PageSize = PdfPageSize.A4
60+
};
4261

4362
public int Dpi { get; set; }
4463
public int ImageDpi { get; set; }
4564
public int ImageQuality { get; set; }
4665
public PdfMarginSettings Margin { get { return _margins; } }
66+
67+
/// <summary>
68+
/// Should we generate an outline and put it into the pdf file
69+
/// </summary>
4770
public bool Outline { get; set; }
4871

72+
/// <summary>
73+
/// The file where in to store the output
74+
/// </summary>
4975
public string Out { get; set; }
5076
public PdfOrientation Orientation { get; set; }
5177

78+
/// <summary>
79+
/// Size related settings
80+
/// </summary>
81+
public PdfSize Size { get { return _size; } }
82+
5283
// TODO: Add as many as you need..
5384
}
5485
}

0 commit comments

Comments
 (0)