DeviceFontSubstitution DeviceFontSubstitution DeviceFontSubstitution DeviceFontSubstitution Enum

Definición

Especifica si está habilitada la sustitución de fuentes de dispositivo en una impresora.Specifies whether device font substitution is enabled on a printer.

public enum class DeviceFontSubstitution
public enum DeviceFontSubstitution
type DeviceFontSubstitution = 
Public Enum DeviceFontSubstitution
Herencia
DeviceFontSubstitutionDeviceFontSubstitutionDeviceFontSubstitutionDeviceFontSubstitution

Campos

Off Off Off Off 1

La sustitución de las fuentes de dispositivo está deshabilitada.Device font substitution is disabled.

On On On On 2

La sustitución de las fuentes de dispositivo está habilitada.Device font substitution is enabled.

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

En el ejemplo siguiente se muestra cómo determinar las capacidades de la impresora y configurar el trabajo de impresión para que pueda beneficiarse de ellas.The following example shows how to determine printer 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

La impresión es más rápida cuando solo se envía a la impresora el texto, no la fuente.Printing is faster when only the text, not the font, is sent to the printer. Algunas impresoras tienen fuentes que se almacenan de forma permanente en su memoria.Some printers have fonts that are permanently stored in their memory. Estas impresoras permiten a los usuarios sustituir una fuente de impresora residente por cada fuente utilizada por la aplicación de impresión.These printers enable users to substitute a resident printer font for each font that is used by the printing application.

Los valores de este tipo se usan principalmente para estos propósitos:The values of this type are used primarily for these purposes:

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

Nunca debe establecer una PrintTicket propiedad en Unknown.You should never set a PrintTicket property to Unknown. Si alguna otra PrintTicket aplicación que produce ha creado un documento PrintTicket que establece la característica de sustitución de fuentes de dispositivo en una opción desconocida (es decir, una opción que no está definida en el esquemade impresión PrintTicket ), entonces un objeto en la aplicación que se crea con ese documento se desconoce como el valor de la DeviceFontSubstitution propiedad.If some other PrintTicket producing application has created a PrintTicket document that sets the device font substitution 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 DeviceFontSubstitution property.

Aunque las PrintTicket clases PrintCapabilities y no se pueden heredar, puede extender el esquema de impresión para que reconozca las características del dispositivo de impresión que DeviceFontSubstitution no se tienen en cuenta en las clases o. PrintCapabilitiesAlthough 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 DeviceFontSubstitution or PrintCapabilities classes. Para obtener más información, consulte Cómo Extienda el esquema de impresión y cree nuevas clasesdel sistema de impresión.For more information, see How to: Extend the Print Schema and Create New Print System Classes.

Se aplica a

Consulte también: