View as MarkdownMarkdown
To speed up the printing of a PDF file and reduce its size, you can convert it from RGB color space to grayscale.
To convert a PDF file to grayscale, set the setConvertToGrayScale() method to true.
The following code snippet shows how to convert a PDF file to grayscale:
The following image demonstrates the result:

We value your opinion. Your feedback will help us improve our documentation.