PrintCapabilities.StaplingCapability Property


Gets a collection of values that identify the types of automatic stapling that a printer supports.

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

public ReadOnlyCollection<Stapling> StaplingCapability { get; }

If the printer does not support stapling, the collection is empty.

This property corresponds to the Print Schema's JobStapleAllDocuments keyword, not the DocumentStaple keyword.

The following example shows how to use this property to determine the capabilities of a specific printer and how to configure a print job to take advantage of them.

// ---------------------- GetPrintTicketFromPrinter -----------------------
/// <summary>
///   Returns a PrintTicket based on the current default printer.</summary>
/// <returns>
///   A PrintTicket for the current local default printer.</returns>
private PrintTicket GetPrintTicketFromPrinter()
    PrintQueue printQueue = null;

    LocalPrintServer localPrintServer = new LocalPrintServer();

    // Retrieving collection of local printer on user machine
    PrintQueueCollection localPrinterCollection =

    System.Collections.IEnumerator localPrinterEnumerator =

    if (localPrinterEnumerator.MoveNext())
        // Get PrintQueue from first available printer
        printQueue = (PrintQueue)localPrinterEnumerator.Current;
        // No printer exist, return null PrintTicket
        return null;

    // Get default PrintTicket from printer
    PrintTicket printTicket = printQueue.DefaultPrintTicket;

    PrintCapabilities printCapabilites = printQueue.GetPrintCapabilities();

    // Modify PrintTicket
    if (printCapabilites.CollationCapability.Contains(Collation.Collated))
        printTicket.Collation = Collation.Collated;

    if ( printCapabilites.DuplexingCapability.Contains(
            Duplexing.TwoSidedLongEdge) )
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge;

    if (printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft))
        printTicket.Stapling = Stapling.StapleDualLeft;

    return printTicket;
}// end:GetPrintTicketFromPrinter()

.NET Framework
Available since 3.0
Return to top