Extraction Text: Failed to compare two elements in the array

Help
2013-05-07
2013-05-12
  • Rico Sørensen

    Rico Sørensen - 2013-05-07

    Hi
    Im using the advanceText extraction method and in some of mine PDF-documents, primarly the last im getting the exception:

    Failed to compare two elements in the array. ---> System.InvalidOperationException: Nullable object must have a value.
    at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
    at System.Nullable1.get_Value() at org.pdfclown.tools.TextExtractor.TextStringPositionComparer1.Compare(T textString1, T textString2) in C:\Users\pc\Documents\Visual Studio 2010\Projects\PDFClown\dotNET\pdfclown.lib\src\org\pdfclown\tools\TextExtractor.cs:line 209
    at System.Collections.Generic.ArraySortHelper1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer1 comparer, Int32 depthLimit)
    at System.Collections.Generic.ArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer)

    It's like the RectangleF box1 = textString1.Box.Value or RectangleF box2 = textString2.Box.Value; some times is Null.

    I can't use the simpel Text extraction, because my text is placed in boxes so it will be split over two lines, if i'm not using the extractor.Extract(page) [TextExtractor.DefaultArea] method.

    thanks
    Rico

     
  • Rico Sørensen

    Rico Sørensen - 2013-05-07

    Sorry here is my test pdf

     
  • Rico Sørensen

    Rico Sørensen - 2013-05-12

    Update: It's only when a Textstring is Empty, Then the "Box" rectangle do not get set for the text.

    Any suggestions?

     

Log in to post a comment.