PageSettings.PaperSize Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the paper size for the page.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

public PaperSize PaperSize { get; set; }

Property Value

Type: System.Drawing.Printing.PaperSize

A PaperSize that represents the size of the paper. The default is the printer's default paper size.

Exception Condition

The printer named in the PrinterSettings.PrinterName property does not exist or there is no default printer installed.

A PaperSize represents the size of the paper through the PaperSize.Kind property, which contains one of the PaperKind values.

Set the PaperSize property for the page to a valid PaperSize, available through the PrinterSettings.PaperSizes collection.

For information about how you can specify a custom paper size, see the PaperSize constructor.

The following code example sets three properties for the document's default page, including the paper size based upon the size selected in the comboPaperSize combo box, and then prints the document using the Print method. The example requires that a PrintDocument variable named printDoc exists and that the specific combo boxes exist.

// Add list of supported paper sizes found on the printer. 
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSize.DisplayMember = "PaperName";

PaperSize pkSize;
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++){
    pkSize = printDoc.PrinterSettings.PaperSizes[i];

// Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
PaperSize pkCustomSize1 = new PaperSize("First custom size", 100, 200);


// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display string.

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
    pkSource = printDoc.PrinterSettings.PaperSources[i];
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display string.

PrinterResolution pkResolution;
for (int i = 0; i < printDoc.PrinterSettings.PrinterResolutions.Count; i++){
    pkResolution = printDoc.PrinterSettings.PrinterResolutions[i];
private void MyButtonPrint_Click(object sender, System.EventArgs e)
    // Set the paper size based upon the selection in the combo box.
    if (comboPaperSize.SelectedIndex != -1) {
        printDoc.DefaultPageSettings.PaperSize = 

    // Set the paper source based upon the selection in the combo box.
    if (comboPaperSource.SelectedIndex != -1) {
        printDoc.DefaultPageSettings.PaperSource = 

    // Set the printer resolution based upon the selection in the combo box.
    if (comboPrintResolution.SelectedIndex != -1) 

    // Print the document with the specified paper size, source, and print resolution.

.NET Framework
Available since 1.1
Return to top