OutputQuality OutputQuality OutputQuality OutputQuality Enum

定义

指定打印设备输出质量的类型。Specifies the types of output quality for a print device.

public enum class OutputQuality
public enum OutputQuality
type OutputQuality = 
Public Enum OutputQuality
继承
OutputQualityOutputQualityOutputQualityOutputQuality

字段

Automatic Automatic Automatic Automatic 1

根据打印作业的内容自动选择质量类型。Automatically selects a quality type that is based on the contents of a print job.

Draft Draft Draft Draft 2

草稿质量。Draft quality.

Fax Fax Fax Fax 3

传真质量。Fax quality.

High High High High 4

高于正常质量。Higher than normal quality.

Normal Normal Normal Normal 5

正常质量。Normal quality.

Photographic Photographic Photographic Photographic 6

照片质量。Photographic quality. 有关详细信息,请参阅“备注”部分中的 OutputQuality.Photographic 相关说明For more information, see Notes on OutputQuality.Photographic in the Remarks section.

Text Text Text Text 7

文本质量。Text quality.

Unknown Unknown Unknown Unknown 0

该功能(其选项由此枚举表示)设置为未在 打印架构中定义的选项。The feature (whose options are represented by this enumeration) is set to an option not defined in the Print Schema.

示例

下面的示例演示如何测试打印机的功能和配置打印的作业,以充分利用它们。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()

注解

主要用于以下目的使用此类型的值:Use the values of this type primarily for these purposes:

Unknown属性中永远不会使用值PrintCapabilities对象。The Unknown value is never used in properties of PrintCapabilities objects.

绝不应设置PrintTicket属性设置为UnknownYou should never set a PrintTicket property to Unknown. 如果某一其他PrintTicket生成应用程序已创建PrintTicket 文档输出质量功能设置为无法识别的选项 (即,未在中定义的选项打印架构),则PrintTicket使用该文档构造应用程序中的对象将具有Unknown的值作为OutputQuality属性。If some other PrintTicket producing application has created a PrintTicket document that sets the output quality 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 OutputQuality property.

尽管PrintTicketPrintCapabilities类不能被继承,可以扩展打印架构识别并不表示中的打印设备功能PrintTicketPrintCapabilities类。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. 有关详细信息,请参阅操作说明:扩展的打印架构并创建新的打印系统类For more information see How to: Extend the Print Schema and Create New Print System Classes.

Notes on OutputQuality.PhotographicNotes on OutputQuality.Photographic

从开始.NET Framework 4.6.1.NET Framework 4.6.1,打印到基于 GDI 的打印机和 Windows 7 和早期版本的 Windows 上运行时,获取图像的值的输出质量已改进 (相对于以前版本的.NET Framework)操作系统。Starting with the .NET Framework 4.6.1.NET Framework 4.6.1, the output quality obtained with the Photographic value is improved (compared to previous versions of the .NET Framework) when printing to a GDI-based printer and when running on Windows 7 and earlier versions of the Windows operating system.

生成具有输出质量更好的文档要求更大的打印后台处理程序文件和等待时间较长。Producing documents with better output quality requires larger print spooler files and longer wait times. 如果这些副作用是不可取,则可以改用高值。If these side effects are undesirable, you can instead use the High value.

适用于

另请参阅