Printing color PDF in black and white

I am trying to print a color PDF in black and white. Setting the System.Drawing.Printing.PageSettings.Color property to false does not work. Can you please advise me on how to print a color PDF in black and white?

Here is the code I am using:

System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();

ps.PrinterName = printerName;
ps.Copies = copies;
pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
pgs.Landscape = false;

pgs.Color = false;

Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense("Turners.Crm.Core.Aspose.Pdf.lic");
license.Embedded = true;

using (PdfViewer viewer = new PdfViewer())
{
    viewer.PrintPageDialog = false;
    using (Stream s = new MemoryStream(pdfInvoice))
    {
        viewer.BindPdf(s);
        viewer.PrintDocumentWithSettings(pgs, ps);
    }
}

Hi there,

Thanks for your inquiry. Please amend your code as following, set PrintAsImage property to true to get black and white print.

Hopefully, it will serve the purpose.

......
viewer.BindPdf(s);
viewer.PrintAsImage = true;
viewer.PrintDocumentWithSettings(pgs, ps);
......

Please feel free to contact us for any further assistance.

Best Regards,

Hi Chris,

Thanks for using our products.

Adding more to Tilal’s comments, I’m sure you’ll be interested to know that when using viewer.PrintAsImage = true; property and when trying to print the documents to XPS document writer, not all PDF files are printed as Black & White. Furthermore, please note that this property indicates that all the contents (image, text, form fields etc) are printed as image in the resulting output.

In order to fulfill your requirement to print the output as Black and White, I have logged this requirement in our issue tracking system under New Features list as PDFNEWNET-35728. We will further investigate this requirement in detail and will keep you updated on the status of a correction.

We apologize for your inconvenience.