In Development
Last Updated: 12 Apr 2024 20:51 by ADMIN
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