Reference Guide
GdPicture14 Namespace / GdPicturePDF Class / PrintSetCollate Method
The new value of the printer collate setting. Set this parameter to true if you want the document to be collated when printing, otherwise set it to false.
Example





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

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

    Syntax
    'Declaration
     
    
    Public Function PrintSetCollate( _
       ByVal Collate As Boolean _
    ) As GdPictureStatus
    public GdPictureStatus PrintSetCollate( 
       bool Collate
    )
    public function PrintSetCollate( 
        Collate: Boolean
    ): GdPictureStatus; 
    public function PrintSetCollate( 
       Collate : boolean
    ) : GdPictureStatus;
    public: GdPictureStatus PrintSetCollate( 
       bool Collate
    ) 
    public:
    GdPictureStatus PrintSetCollate( 
       bool Collate
    ) 

    Parameters

    Collate
    The new value of the printer collate setting. Set this parameter to true if you want the document to be collated when printing, otherwise set it to false.

    Return Value

    A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

    We strongly recommend always checking this status first.

    Remarks
    It is recommend to use the GetStat method or the PrintGetStat method to identify the specific reason for the method's failure, if any.

    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 set up some printer properties to be used for printing the current document.
    Dim caption As String = "Example: PrintSetCollate"
    Dim oGdPicturePDF As GdPicturePDF = 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
            oGdPicturePDF.PrintSetAlignment(PrintAlignment.PrintAlignmentMiddleCenter)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    alignment: MiddleCenter" + vbCrLf
            Else
                message = "The PrintSetAlignment() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetAutoRotation(True)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    auto-rotation: True" + vbCrLf
            Else
                message = "The PrintSetAutoRotation() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetCollate(True)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    collate: True" + vbCrLf
            Else
                message = "The PrintSetCollate() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetColorMode(PrinterColorMode.PrinterColorModeColor)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    color mode: Color" + vbCrLf
            Else
                message = "The PrintSetColorMode() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetDuplexMode(System.Drawing.Printing.Duplex.Simplex)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    duplex: Simplex" + vbCrLf
            Else
                message = "The PrintSetDuplexMode() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetOrientation(PrinterOrientation.PrinterOrientationPortrait)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    orientation: Portrait" + vbCrLf
            Else
                message = "The PrintSetOrientation() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            oGdPicturePDF.PrintSetQuality(PrintQuality.PrintQualityHighResolution)
            If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
                message = message + "    quality: High" + vbCrLf
            Else
                message = "The PrintSetQuality() method has failed with the status: " + oGdPicturePDF.GetStat()
            End If
        End If
        If oGdPicturePDF.GetStat() = GdPictureStatus.OK Then
            If oGdPicturePDF.Print() = GdPictureStatus.OK Then
                message = message + "The file has been printed successfully using new settings."
            Else
                message = message + "The file can't be printed." + vbCrLf + "Status: " + oGdPicturePDF.PrintGetStat().ToString()
                If oGdPicturePDF.PrintGetStat() = GdPictureStatus.PrintingException Then
                    message = message + "    Error: " + oGdPicturePDF.PrintGetLastError()
                End If
            End If
        Else
            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: PrintSetCollate";
    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)
        {
            oGdPicturePDF.PrintSetAlignment(PrintAlignment.PrintAlignmentMiddleCenter);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    alignment: MiddleCenter\n";
            else
                message = "The PrintSetAlignment() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetAutoRotation(true);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    auto-rotation: true\n";
            else
                message = "The PrintSetAutoRotation() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetCollate(true);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    collate: true\n";
            else
                message = "The PrintSetCollate() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetColorMode(PrinterColorMode.PrinterColorModeColor);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    color mode: Color\n";
            else
                message = "The PrintSetColorMode() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetDuplexMode(System.Drawing.Printing.Duplex.Simplex);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    duplex: Simplex\n";
            else
                message = "The PrintSetDuplexMode() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetOrientation(PrinterOrientation.PrinterOrientationPortrait);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    orientation: Portrait\n";
            else
                message = "The PrintSetOrientation() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            oGdPicturePDF.PrintSetQuality(PrintQuality.PrintQualityHighResolution);
            if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
                message = message + "    quality: High\n";
            else
                message = "The PrintSetQuality() method has failed with the status: " + oGdPicturePDF.GetStat();
        }
        if (oGdPicturePDF.GetStat() == GdPictureStatus.OK)
        {
            if (oGdPicturePDF.Print() == GdPictureStatus.OK)
            {
                message = message + "The file has been printed successfully using new settings.";
            }
            else
            {
                message = message + "The file can't be printed.\nStatus: " + oGdPicturePDF.PrintGetStat().ToString();
                if (oGdPicturePDF.PrintGetStat() == GdPictureStatus.PrintingException)
                    message = message + "    Error: " + oGdPicturePDF.PrintGetLastError();
            }
        }
        else
        {
            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