.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfQueryPageSettingsEventArgs.PrintInGrayscale Property

Gets or sets a value which indicates whether to print the document content in grayscale.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.1.Drawing.dll

Declaration

public bool PrintInGrayscale { get; set; }

Property Value

Type Description
Boolean

true to print a document content in grayscale; false the current printer settings are used.

Remarks

Use the PrintInGrayscale property to override print color setting made before a document page is printed.

The property is set to false by default. The true option of the PrintInGrayscale property is used if a printer can’t print a document in grayscale using the standard PageSettings.Color property set to false.

The code below shows how to specify the PrintInGrayscale property value when the PdfViewer.QueryPageSettings event is handled.

using DevExpress.Pdf;
using DevExpress.XtraPdfViewer;
//...
        private void Form1_Load(object sender, EventArgs e) {
            PdfViewer pdfViewer = this.pdfViewer1;
            pdfViewer1.QueryPageSettings += pdfViewer1_QueryPageSettings;
        }

        void pdfViewer1_QueryPageSettings(object sender, PdfQueryPageSettingsEventArgs e) {
            if (e.PageNumber == 2)
                e.PrintInGrayscale = true;
        }
See Also