I am using the Aspose PDF library for .NET, version 10.7.
- The images are not being converted into grayscale, but rather as black and white, which leads to poor converted image quality
- Not all images are being converted and not all background colors convert to grayscale.
- When attempting to convert some PDF documents an Index was outside the bounds of the array exception is thrown by the Aspose.Imaging.Save method
[IndexOutOfRangeException: Index was outside the bounds of the array.]
..( ) +275
..(Int32 , Int32& , Int32& , Int32[] , Int32& , ) +403
..(Int32[] , Int32 , Int32 , Int32 , , Int32[] , Int32& , Int32[] , Int32& , Boolean ) +308
..e(Int32[] , Rectangle , ) +930
..Process(Rectangle , Int32[] , Point , Point ) +62
..Process(Rectangle , Int32[] , Point , Point ) +126
..Process(Rectangle ) +239
..Process(Rectangle , , , Int32 , Int32 ) +1118
..(Rectangle , ) +65
..Process(Rectangle ) +43
..Process(Rectangle , , , Int32 , Int32 ) +1118
..(Rectangle , Int32[] , Boolean , ) +236
..(Rectangle , Boolean , ) +359
..(Rectangle , ) +76
..Save( , , Boolean , , ) +797
..(Image , Stream , ) +417
Aspose.Imaging.Image.Save(Stream , ) +72[: Image export failed.]
Aspose.Imaging.Image.Save(Stream , ) +197
Aspose.Pdf.XImageCollection.(Stream , a , ) +260
Aspose.Pdf.XImageCollection.(Int32 , Stream , Int32 , Boolean ) +178
Aspose.Pdf.XImageCollection.Replace(Int32 , Stream , Int32 , Boolean ) +32
Aspose.Pdf.Engine.Presentation.RgbToDeviceGrayConversionStrategy.(Resources ) +140
Aspose.Pdf.Engine.Presentation.RgbToDeviceGrayConversionStrategy.Convert(Page page) +42
appNet.Helpers.MakePdfGrayscale(…) +1808
Thanks!