2022.2

Table Of Contents
set()
SetsanewDataMapperrecordboundary.
set(delimiters)
delimiters
Setsanewrecordboundary.Thedelimitersparameterisanoffsetfromthecurrentdelimiter,
expressedinanintegerthatrepresentsanumberofdelimiters.
Ifthisparameterisnotspecified,thenavalueof0isassumed.Avalueof0indicatestherecordbound-
aryoccursonthecurrentdelimiter.
Anegativevalueof-nindicatesthattherecordboundaryoccurred-ndelimitersbeforethecurrent
delimiter.
Apositivevalueofnindicatesthattherecordboundaryoccurs+ndelimitersafterthecurrentdelimiter.
Note: SpecifyingapositivevaluenotonlysetstheDataMapperrecordboundarybutitalso
advancesthecurrentdelimitertothespecifieddelimiter.That'swheretheprocessingresumes.
Thisallowsyoutoskipsomepages/recordswhenyouknowtheydonotneedtobeexamined.
Negative(or0)valuessimplysettheboundarywithoutchangingthecurrentlocation.
Example
ThisscriptsetsaboundarywhenthetextTOTALisfoundonthecurrentpageinaPDFfile.
Thenumberofdelimitersissetto1,sotheboundaryissetonthenextdelimiter,whichisthestartofthe
nextpage.
if (boundaries.find("TOTAL", region.createRegion(10,10,215,279)).found) {
boundaries.set(1);
}
Assumeyouwanttosetrecordboundarieswheneverthetext"TOTAL"appearsinaspecificregionof
thepageofaPDFfile,butthePDFfilehasalreadybeenpaddedwithblankpagesforduplexingpur-
poses.Theboundaryshouldthereforebeplacedattheendofthepagewherethematchisfoundifthat
matchoccursonanevenpage,orattheendofthenextblankpage,ifthematchoccursonanodd
page.RecallthatforPDFfiles,thenaturaldelimiterisaPDFpage.TheJavaScriptcodewouldlook
somethinglikethefollowing:
var myRegion = region.createRegion(150,220,200,240);
if(boundaries.find("TOTAL", myRegion).found) {
/* a match was found. Check if we are on an odd or even page and set the Boundary accordingly */
if((boundaries.currentDelim % 2) !=0 ) {
/* Total is on odd page, let's set the document Boundary one delimiter further, thereby skipping the next blank page */
boundaries.set(1);
} else {
/* Total is on an even page, set the document Boundary to the current delimiter */
boundaries.set();
Page 373