Field definitioni in datamapper on multiple pages of a pdf input file

I need to look at all pages (which can vary) in a pdf document and map a field. Ideally, I would concatenate all data from specific location on every page to make 1 field. Currently, I am just mapping a location on the first page, but need to concatenate the results from the rest of the pages in the record. How can I do that? Thank you!

At first, you need to define that your record is the complete PDF. To do so, under the tab Settings, go to the Boundaries section and select the TriggerOn all pages”. Then, extract all the fields on all pages, as to know what are their exact position. Better, you will know their exact location and the javascript code to extract them will be build for you. You can find it for each field under the Step Properties tab, Field Definition section. Select Javascript where it says Mode. You’ll see that next to Expression, you now have the exact Javascript expression to extract that specific field from your PDF pages.

Copy all of those to an external text editor and delete them all from your Datamapper.

Now add a new Extraction from anywhere on the PDF pages. Again, under the Step Properties tab, Field Definition section. Select Javascript where it says Mode. To the far right of the Step Properties tab at the level of the Expression, there is an icon that looks like a little sheet of paper with a pencil on it.

Click on it, that will open the Javascript editor.

In it, write your fields concatenation of all those you have copied in your text editor.

Hope that helps.

The pdf for each document will vary in length from 2 to 150 pages. I need to look at each page at the same location and concatenate it together and store in same field for that record. So if I understand this correctly, I could write a script that would loop through the number of pages and do a calculation to figure out the top location and then concatenate those together? Do you happen to know what number I need to add to find the same starting place on the next page? Do you know of any examples of scripts? Thank you.

Then that is a little different.
See the attached example.
untitled.OL-datamapper (459.7 KB) Untitled.OL-template (6.8 KB)

We are running version 2021.1.1.6675 and I can’t open the files… Is yours in a newer version? Thank you.

I am in 2021.2.1.

I saved it in a previous version. Try these.untitled.OL-datamapper (460.2 KB) Untitled.OL-template (7.5 KB)

I think that I got it work. Thanks for the help.