PageSettings.PaperSource Property


Gets or sets the page's paper source; for example, the printer's upper tray.

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

public PaperSource PaperSource { get; set; }

Property Value

Type: System.Drawing.Printing.PaperSource

A PaperSource that specifies the source of the paper. The default is the printer's default paper source.

Exception Condition

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

A PaperSource represents the source of the paper through the PaperSource.Kind property, which contains one of the PaperSourceKind values.

Set the PaperSource property for the page to a valid PaperSource, available through the PrinterSettings.PaperSources collection.

The following code example sets three properties for the document's default page, including the paper source based upon the source selected in the comboPaperSource 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