Home

All Blogs

Convert an Image to Grayscale PDF for Better OCR in C# or Java

Updated January 27, 2026

Read time

15 min

email
linkedIn
twitter
link

Convert an Image to Grayscale PDF for Better OCR in C# or Java

Sanity Image

Apryse

Pre-processing is a critical step in improving the accuracy and quality of OCR results, and that may be why many developers are looking for the best way to convert an image to a black & white PDF file, to more easily import a better-quality file into OCR for text data extraction. With Apryse SDK, it’s easy to convert images to grayscale PDF.

We’ve included sample code showing how to complete this using C# and Java below.

C#

Copied to clipboard

Java

Copied to clipboard

Build reliable TIFF-to-PDF conversion in Java using the Apryse SDK — get started today!

Next Steps

Copied to clipboard

If you’re interested in trying Apryse SDK, you can start your trial right away. If you have any questions, please contact sales or check out our Discord.