Reference Guide
GdPicture14 Namespace / GdPicturePDF Class / PrintGetCollate Method
Example





In This Topic
    PrintGetCollate Method (GdPicturePDF)
    In This Topic
    Returns the printer collate setting of the active printer. This property determines, whether the printed document is collated.

    true will print a complete copy of the document before the first page of the next copy is printed. false will print each page by the number of copies specified before printing the next page.

    Syntax
    'Declaration
     
    
    Public Function PrintGetCollate() As Boolean
    public bool PrintGetCollate()
    public function PrintGetCollate(): Boolean; 
    public function PrintGetCollate() : boolean;
    public: bool PrintGetCollate(); 
    public:
    bool PrintGetCollate(); 

    Return Value

    The value of the printer collate setting. true if the printed document is collated when printing, otherwise false.

    Please always use the GetStat method or the PrintGetStat method to determine if this method has been successful.

    Remarks
    We strongly recommend using the GetStat method or the PrintGetStat method to identify the specific reason for the method's failure.

    Please note that collating is only performed when the number of copies is greater than 1.

    Just to remind you that the active printer is the printer identified by the PrintGetActivePrinter method or set by the PrintSetActivePrinter method and it is dedicated to executing all subsequent print jobs using this class as well as utilizing all by you altered printer settings.

    Example
    How to find out some properties of the active printer.
    Dim caption As String = "Example: PrintGetCollate"
    Dim oGdPicturePDF As New GdPicturePDF()
    Dim message As String = ""
    If (oGdPicturePDF.LoadFromFile("document_to_print.pdf", False) = GdPictureStatus.OK) Then
        Dim curPrinter As String = oGdPicturePDF.PrintGetActivePrinter()
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            message = "Active printer: " + curPrinter + vbCrLf
        Else
            message = "The PrintGetActivePrinter() method has failed with the status: " + oGdPicturePDF.GetStat()
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnAlign As PrintAlignment = oGdPicturePDF.PrintGetAlignment()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    alignment: " + prnAlign.ToString() + vbCrLf
            Else
                message = "The PrintGetAlignment() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnCollate As Boolean = oGdPicturePDF.PrintGetCollate()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    collate: " + prnCollate.ToString() + vbCrLf
            Else
                message = "The PrintGetCollate() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnColorMode As PrinterColorMode = oGdPicturePDF.PrintGetColorMode()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    color mode: " + prnColorMode.ToString() + vbCrLf
            Else
                message = "The PrintGetColorMode() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnDuplex As System.Drawing.Printing.Duplex = oGdPicturePDF.PrintGetDuplexMode()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    duplex: " + prnDuplex.ToString() + vbCrLf
            Else
                message = "The PrintGetDuplexMode() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnOrientation As PrinterOrientation = oGdPicturePDF.PrintGetOrientation()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    orientation: " + prnOrientation.ToString() + vbCrLf
            Else
                message = "The PrintGetOrientation() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            Dim prnQuality As PrintQuality = oGdPicturePDF.PrintGetQuality()
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    quality: " + prnQuality.ToString() + vbCrLf
            Else
                message = "The PrintGetQuality() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() <> GdPictureStatus.OK Then
            message = "The example has NOT been followed successfully. Status: " + oGdPicturePDF.GetStat().ToString()
        End If
    Else
        message = "The file can't be loaded. Status: " + oGdPicturePDF.GetStat().ToString()
    End If
    MessageBox.Show(message, caption)
    oGdPicturePDF.Dispose()
    string caption = "Example: PrintGetCollate";
    GdPicturePDF oGdPicturePDF = new GdPicturePDF();
    string message = "";
    if (oGdPicturePDF.LoadFromFile("document_to_print.pdf", false) == GdPictureStatus.OK)
    {
        string curPrinter = oGdPicturePDF.PrintGetActivePrinter();
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
            message = "Active printer: " + curPrinter + "\n";
        else
            message = "The PrintGetActivePrinter() method has failed with the status: " + oGdPicturePDF.GetStat();
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            PrintAlignment prnAlign = oGdPicturePDF.PrintGetAlignment();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    alignment: " + prnAlign.ToString() + "\n";
            else
                message = "The PrintGetAlignment() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            bool prnCollate = oGdPicturePDF.PrintGetCollate();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    collate: " + prnCollate.ToString() + "\n";
            else
                message = "The PrintGetCollate() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            PrinterColorMode prnColorMode = oGdPicturePDF.PrintGetColorMode();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    color mode: " + prnColorMode.ToString() + "\n";
            else
                message = "The PrintGetColorMode() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            System.Drawing.Printing.Duplex prnDuplex = oGdPicturePDF.PrintGetDuplexMode();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    duplex: " + prnDuplex.ToString() + "\n";
            else
                message = "The PrintGetDuplexMode() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            PrinterOrientation prnOrientation = oGdPicturePDF.PrintGetOrientation();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    orientation: " + prnOrientation.ToString() + "\n";
            else
                message = "The PrintGetOrientation() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            PrintQuality prnQuality = oGdPicturePDF.PrintGetQuality();
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    quality: " + prnQuality.ToString() + "\n";
            else
                message = "The PrintGetQuality() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() != GdPictureStatus.OK)
        {
            message = "The example has NOT been followed successfully. Status: " + oGdPicturePDF.GetStat().ToString();
        }
    }
    else
    {
        message = "The file can't be loaded. Status: " + oGdPicturePDF.GetStat().ToString();
    }
    MessageBox.Show(message, caption);
    oGdPicturePDF.Dispose();
    See Also