Completed
Last Updated: 15 May 2024 14:22 by ADMIN
Release 2024.2.426 (2024 Q2)
Paulo
Created on: 12 Apr 2024 10:17
Category: PdfProcessing
Type: Feature Request
1
PdfProcessing: Handle documents with invalid structure of path construction operators

Currently, a NullReferenceException is thrown because of the incorrect structure. 

As a workaround, the exception can be handled using the Handling Exceptions mechanism.

Update:
When importing documents with invalid structure of path construction operators an InvalidGraphicOperandsCountException is thrown which could be handled using the Handling Exceptions mechanism.

PdfFormatProvider provider = new PdfFormatProvider();
provider.ImportSettings.DocumentUnhandledException += this.ImportSettings_DocumentUnhandledException;

private void ImportSettings_DocumentUnhandledException(object sender, DocumentUnhandledExceptionEventArgs e)
{
    if (e.Exception is InvalidGraphicOperandsCountException)
    {
        e.Handled = true;
    }
}

0 comments