Unplanned
Last Updated: 18 Nov 2024 14:40 by Andrew
Andrew
Created on: 18 Nov 2024 07:37
Category: PdfProcessing
Type: Feature Request
1
PdfProcessing: Handle documents with missing filed type "FT"

When importing a document with button field with missing type, an error occurs.

51 0 obj
<< /Kids [ 70 0 R 71 0 R 72 0 R 73 0 R 74 0 R 75 0 R 76 0 R 77 0 R 78 0 R 79 0 R 80 0 R 81 0 R 82 0 R 83 0 R 84 0 R 85 0 R 86 0 R 87 0 R 88 0 R 89 0 R 90 0 R 91 0 R 92 0 R 93 0 R 94 0 R 95 0 R 96 0 R 97 0 R 98 0 R 99 0 R 100 0 R 101 0 R 102 0 R 103 0 R 104 0 R 105 0 R 106 0 R 107 0 R 108 0 R 109 0 R 110 0 R 111 0 R 112 0 R 113 0 R 114 0 R 115 0 R 116 0 R 14 0 R ] /T (Button 70) >>
endobj

Workaround: Handle the exception: https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/features/handling-document-exceptions 

1 comment
Andrew
Posted on: 18 Nov 2024 14:40

Adding an exception handler solved my issue when trying to get a thumbnail from a page when the above error occurs.

 

   document.DocumentUnhandledException += GetDocumentThumbnail_DocumentUnhandledException;

 

 private void GetDocumentThumbnail_DocumentUnhandledException(object sender, DocumentUnhandledExceptionEventArgs e)
        {
            MessageBox($"The document is corrupted and some pages cannot be loaded:  {OriginalFileName}: " + e.Exception);
            e.Handled = true;
        }