Bagikan melalui


PageMediaType Enum

Definisi

Menentukan tipe kertas cetak atau media lainnya.

public enum class PageMediaType
public enum PageMediaType
type PageMediaType = 
Public Enum PageMediaType
Warisan
PageMediaType

Bidang

Archival 2

Media berkualitas arsip.

AutoSelect 1

Perangkat cetak memilih media.

BackPrintFilm 3

Film khusus back-printing.

Bond 4

Media ikatan standar.

CardStock 5

Stok kartu standar.

Continuous 6

Media umpan berkelanjutan.

EnvelopePlain 7

Amplop standar.

EnvelopeWindow 8

Amplop jendela.

Fabric 9

Media Fabric.

HighResolution 10

Media beresolusi tinggi khusus.

Label 11

Memberi label media.

MultiLayerForm 12

Formulir multipihak terlampir.

MultiPartForm 13

Formulir multipisah individual.

None 29

Media yang tidak dikenal atau tidak terdata.

Photographic 14

Media fotografi standar.

PhotographicFilm 15

Media fotografi film.

PhotographicGlossy 16

Media fotografi glossy.

PhotographicHighGloss 17

Media fotografi gloss tinggi.

PhotographicMatte 18

Media fotografi Matte.

PhotographicSatin 19

Media fotografi Satin.

PhotographicSemiGloss 20

Media fotografi semi-gloss.

Plain 21

Kertas biasa.

Screen 22

Output ke tampilan dalam bentuk berkelanjutan.

ScreenPaged 23

Output ke tampilan dalam bentuk halaman.

Stationery 24

Khusus stasioner.

TabStockFull 25

Stok tab, bukan precut (tab tunggal).

TabStockPreCut 26

Persediaan tab, precut (beberapa tab).

Transparency 27

Lembar transparan.

TShirtTransfer 28

Media yang digunakan untuk mentransfer gambar ke T-shirt.

Unknown 0

Fitur (yang opsinya diwakili oleh enumerasi ini) diatur ke opsi yang tidak ditentukan dalam Skema Cetak.

Contoh

Contoh berikut menunjukkan cara menentukan kemampuan printer dan mengonfigurasi pekerjaan cetak untuk memanfaatkannya.

// ---------------------- 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^ printCapabilities = printQueue->GetPrintCapabilities();

   // Modify PrintTicket
   if (printCapabilities->CollationCapability->Contains(Collation::Collated))
   {
      printTicket->Collation = Collation::Collated;
   }
   if (printCapabilities->DuplexingCapability->Contains(Duplexing::TwoSidedLongEdge))
   {
      printTicket->Duplexing = Duplexing::TwoSidedLongEdge;
   }
   if (printCapabilities->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 printCapabilities = printQueue.GetPrintCapabilities();

    // Modify PrintTicket
    if (printCapabilities.CollationCapability.Contains(Collation.Collated))
    {
        printTicket.Collation = Collation.Collated;
    }

    if ( printCapabilities.DuplexingCapability.Contains(
            Duplexing.TwoSidedLongEdge) )
    {
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge;
    }

    if (printCapabilities.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 printCapabilities As PrintCapabilities = printQueue.GetPrintCapabilities()

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

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

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

    Return printTicket
End Function ' end:GetPrintTicketFromPrinter()

Keterangan

Nilai jenis ini digunakan terutama untuk tujuan ini:

Nilai Tidak Dikenal tidak pernah digunakan dalam properti PrintCapabilities objek.

Anda tidak boleh menyetel PrintTicket properti ke Tidak Diketahui. Jika beberapa aplikasi memproduksi lainnya PrintTicket telah membuat dokumen PrintTicket yang mengatur fitur jenis media halaman ke opsi yang tidak dikenali (yaitu, opsi yang tidak ditentukan dalam Skema Cetak), maka PrintTicket objek dalam aplikasi Anda yang dibangun dengan dokumen tersebut akan memiliki Tidak Diketahui sebagai nilai PageMediaType properti.

PrintTicket Meskipun kelas dan PrintCapabilities tidak dapat diwariskan, Anda dapat memperluas Skema Cetak untuk mengenali fitur perangkat cetak yang tidak diperkirakan di PageMediaType kelas atau PrintCapabilities . Untuk informasi selengkapnya, lihat Cara: Memperluas Skema Cetak dan Membuat Kelas Sistem Cetak Baru.

Berlaku untuk

Lihat juga