2022.2

Table Of Contents
find()
Methodofthedataobjectthatfindsthefirstoccurrenceofastringstartingfromthecurrentposition.
find(stringToFind, leftConstraint, rightConstraint)
Findsthefirstoccurrenceofastringstartingfromthecurrentposition.Thesearchcanbeconstrained
toaseriesofcharacters(inatextfile)ortoaverticalstrip(inaPDFfile)locatedbetweenthegivencon-
straints.
Themethodreturnsnullifthestringcannotbefound.OtherwiseitreturnsaRectValueText(ifthe
datasourceisatextfile)orRectValuePDF(ifthedatasourceisaPDFfile)object.Thisobjectcontains
theabsoluteLeft,Top,RightandBottomcoordinatesofthesmallestpossiblerectanglethatcompletely
enclosesthefirstoccurrenceofthestring.Thecoordinatesareexpressedinanumberofcharactersif
thedatasourceisatextfile,orinmillimetresifthedatasourceisaPDFfile.
Partialmatchesarenotallowed.Theentirestringmustbefoundbetweenthetwoconstraintpara-
meters.
Thedata.find()functiononlyworksonthecurrentpage.Iftherecordcontainsseveralpages,you
mustcreatealoopthatwillperformajumpfromonepagetoanothertodoafind()oneachpage.
Note: Callingthismethoddoesnotmovethecurrentpositiontothelocationwherethestringwas
found.Thisallowsyoutousethemethodasalook-aheadfunctionwithoutdisruptingtherestof
thedatamappingworkflow.
stringToFind
Stringtofind.
leftConstraint
Numberindicatingtheleftlimitfromwhichthesearchisperformed.Thisisexpressedincharactersfor
atextfile,orinmillimetresforaPDFfile.
rightConstraint
Numberindicatingtherightlimittowhichthesearchisperformed.Thisisexpressedincharactersfora
textfile,orinmillimetresforaPDFfile.
Examples
Tolookfortheword"text"onanentireLetterpage(81/2x11inch),thesyntaxis:
data.find("text", 0, 216);
Thenumbers0and216areinmillimetersandindicatetheleftandrightlimits(constraints)withinwhich
thesearchshouldbeperformed.Inthisexample,thesevaluesrepresenttheentirewidthofapage.
Page 386