IRONSOFTWAREHOME
Set to Grayscale
using IronPdf;

var renderer = new ChromePdfRenderer();

// Set Color and Grayscale
renderer.RenderingOptions.GrayScale = true;

renderer.RenderHtmlFileAsPdf("my-content.html").SaveAs("my-content.pdf");
Imports IronPdf

Dim renderer = New ChromePdfRenderer()

' Set Color and Grayscale
renderer.RenderingOptions.GrayScale = True

renderer.RenderHtmlFileAsPdf("my-content.html").SaveAs("my-content.pdf")
NuGet Download
PM > Install-Package IronPdf
Set to Grayscale

Set to Grayscale

When rendering an HTML page to PDF with IronPDF, output options for the ChromePdfRenderer class can be changed to create a custom document that fits your needs. These options include paper size, DPI, headers and footers, and other Chromium-specific browser setup options. IronPDF also has the option to set your PDF color to grayscale.

This example shows you how to render your PDF document to grayscale.

Converting your document to grayscale makes the colors wash down to black and white. This makes printing on black and white printers easy. The grayscale option in the ChromePdfRenderer class outputs a black and white PDF document. However, the default value is false. If you want the document to render in grayscale, you would have to manually put in the grayscale settings.

This code snippet demonstrates how to render an HTML document to a grayscale PDF using the IronPDF library.

  1. ChromePdfRenderer Instance: We begin by creating an instance of ChromePdfRenderer. This class provides methods for converting HTML to PDFs.
  2. Set Rendering Options: The RenderingOptions property of the renderer is used to specify how we want the PDF to be rendered. The GrayScale property is set to true to enable grayscale rendering. By default, PDFs are not rendered in grayscale unless specified.
  3. Render HTML: We call the RenderHtmlAsPdf method on the Renderer object, passing in a simple HTML string. This method converts the HTML content to a PDF format.
  4. Save the PDF: Finally, the SaveAs method is used to save the rendered PDF to a file named "GrayscalePDF.pdf" on the disk.

To learn more about the capabilities of IronPDF and other Iron Software libraries such as IronBarcode and IronOCR, you can visit the IronPDF Website and explore other resources and documentation available on Iron Software's Official Site.

Explore the How-to Guide for Grayscale PDF Conversion.
View on GitHub

Ready to Get Started?

Nuget Downloads 21,062,892Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999