In Development
Last Updated: 14 Jan 2025 12:52 by ADMIN
MVDH
Created on: 27 Nov 2023 07:29
Category: PdfProcessing
Type: Bug Report
0
PdfProcessing: IndexOutOfRangeException is thrown when encoding an image with Grayscale color space
When encoding an image with Grayscale color space an exception is thrown: IndexOutOfRangeException: 'Index was outside the bounds of the array.'
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 14 Jan 2025 12:52

Hi,

As of Q1 2025 the PdfExportSettings will offer the DocumentUnhandledException event which is purposed to allow our clients to handle exceptions while exporting a document. A sample code snippet of the API is shown in the following example:

PdfFormatProvider provider = new PdfFormatProvider();
PdfExportSettings settings = new PdfExportSettings();
provider.ExportSettings = settings;
settings.DocumentUnhandledException += (s, e) =>
{
    Debug.WriteLine("The document is corrupted and cannot be exported: " + e.Exception.Message);
    e.Handled = true;
};

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.