Community

Find region on pages, depending on coordinates of element on page 1

FLS: I have specific word only on document page 1(this word can be on random place, but only on page 1), i found it as element.
After it, i need to get coordinates of this element to use it on pre-search relations on other pages for other elements.

Question: How can I get region/coordinates of this specific element on page 1 in advanced pre-search relations (to use this coordinates on on other pages)? 

Thanks!

Was this article helpful?

1 out of 1 found this helpful

Comments

10 comments

  • Avatar
    Adrian Enders

    You will need to reference that elements search area in a script. Simple examples are in the help. Here is a link. Look at the examples for "RestrictSearchArea".

    RestrictSearchArea: ElementName.Region;

    I'm not sure exactly what you want to do, but you can reference other elements in the advanced pre-search relations, sure.

    1
  • Avatar
    Rahul Kapoor

    Interesting question. To solve, you can use the RestrictSearchArea function. Below is the solution to this:

    Function to be used:
    Void RestrictSearchArea( FuzzyRect, IntArray pages ) - Limits the search area by the fuzzy rectangle fuzzyRect. Specify the local coordinates and page range pages.

    Code (to be written in the field to be found in page 2):
    RestrictSearchArea(SearchElements.st_FieldOnPageOne.Rect, 2);

    -
    Regards,
    Rahul
    linkedin.com/in/rahulkapoor309/

    1
  • Avatar
    RobertI

    RestrictSearchArea(SearchElements.st_FieldOnPageOne.Rect, 2); - Did not work for me. 

    Probably, I'm doing something wrong. 

    I created anchor element (FieldOnPageOne) for search on page 1 (element found), after that, created "region" element with RSA in pre-search relations like in example above.

    But when I try to Match it (ctrl+e),  "region" element not created for page 2.
    It looks like it need for FLS same element (FieldOnPageOne) on page 2 too.

    Can I somehow change "SearchElements.st_FieldOnPageOne.Rect" to something like 
    "Page(1).SearchElements.st_FieldOnPageOne.Rect" or "SearchElements.st_FieldOnPageOne[0].Rect" to refer to a specific found object?

    1
  • Avatar
    Rahul Kapoor

    Do not match (ctrl+e). It just matches the single page.
    Right click on the document and select "Match Reference Document" (Ctrl+Shift+E) to match all pages

    0
  • Avatar
    RobertI

    "Right click on the document and select "Match Reference Document" (Ctrl+Shift+E) to match all pages" - Didn't help.

    I will describe the problem: I have a nonstructured document with table, witch loses the table header on page 2 and so on. (Header only on page 1).
    I thought about get regions of columns on page 1 by header names, and after that, use their rect on other pages to read table correctly.

    In my case, document can switch column orer, so i can't navigate by them using separator element.
    That's why I'm trying to ger rect of elements on page 1, and use them on other pages.

    ____________________________________________________________________

    I match all pages (Ctrl+Shift+E), you can see on screen below that i have element on first page, but on second page it does not save same region (RegionElement).

    How can I get the same region on page 2, that i have on page 1?

    0
  • Avatar
    Rahul Kapoor

    You are doing it incorrectly. You don't even need headers on page 2. You can still capture the rows on page 2 with the use of headers from page 1.

    1
  • Avatar
    RobertI

    Rahul Kapoor, tell me please, how i can do that? (I am read table as repeating group)

    0
  • Avatar
    Rahul Kapoor

    If you can share the FLS project with 1 sample. I can fix that for you.

    0
  • Avatar
    RobertI

    can't share from work computer :(

    0
  • Avatar
    Adrian Enders

    Can you share the sample document with Rahul and I? You are just thinking about this incorrectly. Tables and Repeating Groups will work across multiple pages if constructed correctly. You don't have to "reference" anything on page 1. You just have to construct the repeating group correctly. It is difficult for us to assist without having a sample. There are too many variables involved without actually have samples of the document.

    0

Please sign in to leave a comment.