OutputQuality 列舉

定義

指定列印裝置的輸出品質類型。Specifies the types of output quality for a print device.

public enum class OutputQuality
public enum OutputQuality
type OutputQuality = 
Public Enum OutputQuality
繼承
OutputQuality

欄位

Automatic 1

自動根據列印工作的內容選取品質類型。Automatically selects a quality type that is based on the contents of a print job.

Draft 2

草稿品質。Draft quality.

Fax 3

傳真品質。Fax quality.

High 4

高於普通品質。Higher than normal quality.

Normal 5

普通品質。Normal quality.

Photographic 6

相片品質。Photographic quality. 如需詳細資訊,請參閱<備註>一節中的 OutputQuality.Photographic 注意事項For more information, see Notes on OutputQuality.Photographic in the Remarks section.

Text 7

文字品質。Text quality.

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. 執行個體時提供 SQL Server 登入。.

// ---------------------- 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:

值永遠不會用於物件的PrintCapabilities屬性中。 UnknownThe Unknown value is never used in properties of PrintCapabilities objects.

您絕對不應該將PrintTicket屬性設定Unknown為。You should never set a PrintTicket property to Unknown. 如果某些其他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.

PrintCapabilities PrintTicket 雖然無法繼承PrintCapabilities和類別, 但是您可以擴充列印架構, 以辨識或類別中未納入的列印裝置功能。 PrintTicketAlthough 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

從開始, 當列印到以 GDI 為基礎的印表機時, 以及在 windows 7 和舊版 windows 上執行時, 會改善以攝影值取得的輸出品質 (相較于舊版的 .NET Framework) .NET Framework 4.6.1.NET Framework 4.6.1作業系統。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.

適用於

另請參閱