We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Pdf Greyscale


I am trying to convert a pdf to grey scale (black and white) using the following code from your documentation

//using (Aspose.Pdf.Document document = new Aspose.Pdf.Document(filePath))
// Aspose.Pdf.Engine.Presentation.RgbToDeviceGrayConversionStrategy strategy = new Aspose.Pdf.Engine.Presentation.RgbToDeviceGrayConversionStrategy();

// for (int idxPage = 1; idxPage <= document.Pages.Count; idxPage++)
// {
// // get instance of particular page inside PDF
// Aspose.Pdf.Page page = document.Pages[idxPage];
// // convert the RGB colorspace image to GrayScale colorspace
// strategy.Convert(page);
// }
// // save resultant file
// document.Save(outputFilePath);

But the font color is not changed to Black. It still shows some colored fonts.

Please help me out.


Hi Pradeep,

Thanks for using our API’s.

Can you please share the resource PDF files causing this problem, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Here is the sample attached.

I have added different font colors. I want all it to be in greyscale or black and white.

Hi Pradeep,

Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNEWNET-40775 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.


Did you find a solution for this?

Hi Pradeep,

Thanks for your patience.

As we recently have noticed earlier reported issue, so its pending for review and is not yet resolved. However the product team will surely consider investigating/fixing it as per development schedule and as soon as we have some definite updates regarding its resolution, we will let you know. Please be patient and spare us little time. We are sorry for this delay and inconvenience.

The issues you have found earlier (filed as PDFNET-40775) have been fixed in Aspose.PDF for .NET 21.7.