Stapling Stapling Stapling Stapling Enum

Definición

Especifica si una impresora grapa un documento de varias páginas y la posición de las grapas.Specifies whether, and where, a printer staples a multi-page document.

public enum class Stapling
public enum Stapling
type Stapling = 
Public Enum Stapling
Herencia

Campos

None None None None 10

No se grapa el documento.The document is not stapled.

SaddleStitch SaddleStitch SaddleStitch SaddleStitch 1

Varias grapas a lo largo de la línea de pliegue.Multiple staples along the fold line. También se le denomina grapado a caballete.Also called saddle-stitch stapling.

StapleBottomLeft StapleBottomLeft StapleBottomLeft StapleBottomLeft 2

Una sola grapa en la esquina inferior izquierda.A single staple in the lower-left corner.

StapleBottomRight StapleBottomRight StapleBottomRight StapleBottomRight 3

Una sola grapa en la esquina inferior derecha.A single staple in the lower-right corner.

StapleDualBottom StapleDualBottom StapleDualBottom StapleDualBottom 7

Dos grapas a lo largo del margen inferior.Two staples along the lower edge.

StapleDualLeft StapleDualLeft StapleDualLeft StapleDualLeft 4

Dos grapas a lo largo del margen izquierdo.Two staples along the left edge.

StapleDualRight StapleDualRight StapleDualRight StapleDualRight 5

Dos grapas a lo largo del margen derecho.Two staples along the right edge.

StapleDualTop StapleDualTop StapleDualTop StapleDualTop 6

Dos grapas a lo largo del margen superior.Two staples along the upper edge.

StapleTopLeft StapleTopLeft StapleTopLeft StapleTopLeft 8

Una sola grapa en la esquina superior izquierda.A single staple in the upper-left corner.

StapleTopRight StapleTopRight StapleTopRight StapleTopRight 9

Una sola grapa en la esquina superior derecha.A single staple in the upper-right corner.

Unknown Unknown Unknown Unknown 0

La característica (cuyas opciones se representan mediante esta enumeración) está establecida en una opción no definida en el Esquema de impresión.The feature (whose options are represented by this enumeration) is set to an option not defined in the Print Schema.

Ejemplos

El ejemplo siguiente muestra cómo probar las capacidades de la impresora y configurar el trabajo de impresión para sacar provecho de ellas.The following example shows how to test a printer's capabilities and configure the 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>
PrintTicket^ GetPrintTicketFromPrinter () 
{
   PrintQueue^ printQueue = nullptr;

   LocalPrintServer^ localPrintServer = gcnew LocalPrintServer();

   // Retrieving collection of local printer on user machine
   PrintQueueCollection^ localPrinterCollection = localPrintServer->GetPrintQueues();

   System::Collections::IEnumerator^ localPrinterEnumerator = localPrinterCollection->GetEnumerator();

   if (localPrinterEnumerator->MoveNext())
   {
      // Get PrintQueue from first available printer
      printQueue = ((PrintQueue^)localPrinterEnumerator->Current);
   } else
   {
      return nullptr;
   }
   // 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()
// ---------------------- 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 =
        localPrintServer.GetPrintQueues();

    System.Collections.IEnumerator localPrinterEnumerator =
        localPrinterCollection.GetEnumerator();

    if (localPrinterEnumerator.MoveNext())
    {
        // Get PrintQueue from first available printer
        printQueue = (PrintQueue)localPrinterEnumerator.Current;
    }
    else
    {
        // 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()
' ---------------------- GetPrintTicketFromPrinter -----------------------
''' <summary>
'''   Returns a PrintTicket based on the current default printer.</summary>
''' <returns>
'''   A PrintTicket for the current local default printer.</returns>
Private Function GetPrintTicketFromPrinter() As PrintTicket
    Dim printQueue As PrintQueue = Nothing

    Dim localPrintServer As New LocalPrintServer()

    ' Retrieving collection of local printer on user machine
    Dim localPrinterCollection As PrintQueueCollection = localPrintServer.GetPrintQueues()

    Dim localPrinterEnumerator As System.Collections.IEnumerator = localPrinterCollection.GetEnumerator()

    If localPrinterEnumerator.MoveNext() Then
        ' Get PrintQueue from first available printer
        printQueue = CType(localPrinterEnumerator.Current, PrintQueue)
    Else
        ' No printer exist, return null PrintTicket
        Return Nothing
    End If

    ' Get default PrintTicket from printer
    Dim printTicket As PrintTicket = printQueue.DefaultPrintTicket

    Dim printCapabilites As PrintCapabilities = printQueue.GetPrintCapabilities()

    ' Modify PrintTicket
    If printCapabilites.CollationCapability.Contains(Collation.Collated) Then
        printTicket.Collation = Collation.Collated
    End If

    If printCapabilites.DuplexingCapability.Contains(Duplexing.TwoSidedLongEdge) Then
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge
    End If

    If printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft) Then
        printTicket.Stapling = Stapling.StapleDualLeft
    End If

    Return printTicket
End Function ' end:GetPrintTicketFromPrinter()

Comentarios

Los valores de este tipo se utilizan principalmente para estos fines:Use the values of this type primarily for these purposes:

  • Como los miembros de la StaplingCapability colección, que es una propiedad de PrintCapabilities, estos valores indican los tipos de grapado que admite una impresora.As members of the StaplingCapability collection, which is a property of PrintCapabilities, these values indicate the types of stapling that a printer supports.

  • Como el valor de la Stapling propiedad de un PrintTicket, el valor indica a la impresora si y dónde puede para grapar.As the value of the Stapling property of a PrintTicket, the value instructs the printer whether, and where, to staple.

El Unknown valor nunca se utiliza en las propiedades de PrintCapabilities objetos.The Unknown value is never used in properties of PrintCapabilities objects.

Nunca debe establecer un PrintTicket propiedad Unknown.You should never set a PrintTicket property to Unknown. Si algún otro PrintTicket generar la aplicación ha creado un documento PrintTicket que establece la característica de grapado en una opción no reconocida (es decir, una opción que no está definida en el Print Schema), un PrintTicket objeto en la aplicación que se construye con ese documento tendrá Unknown como el valor de la Stapling propiedad.If some other PrintTicket producing application has created a PrintTicket document that sets the stapling feature to an unrecognized option (that is, an option that is not defined in the Print Schema), then a PrintTicket object in your application that is constructed with that document will have Unknown as the value of the Stapling property.

Aunque el PrintTicket y PrintCapabilities no se puede heredar las clases, puede ampliar el Print Schema para reconocer las características del dispositivo de impresión que no se recogen en el PrintTicket o PrintCapabilities clases.Although the PrintTicket and PrintCapabilities classes cannot be inherited, you can extend the Print Schema to recognize print device features that are not accounted for in the PrintTicket or PrintCapabilities classes. Para obtener más información, consulte NOTINBUILD: Cómo: Extender el esquema de impresión y crear nuevas clases de sistema de impresión.For more information see NOTINBUILD: How to: Extend the Print Schema and Create New Print System Classes.

Se aplica a

Consulte también: