|
Set()Sets a new DataMapper record boundary. Related Object: Boundaries.Set(delimiters)Sets a new DataMapper record boundary. Delimiters Sets a new record boundary. The delimiters parameter is an integer number representing an offset from the current delimiter. If this parameter is not specified, then a value of 0 is assumed. A value of 0 indicates the record boundary occurs on the current delimiter. A negative value of -n indicates that the Record boundary occurred -n delimiters before the current delimiter. A positive value of n indicates that the Record boundary occurred +n delimiters after the current delimiter. IMPORTANT NOTESpecifying a positive value not only sets the DataMapper record boundary but it also advances the current delimiter to the specified delimiter. That's where process resumes. This allows you to skip over the processing of some pages/records when you know they do not warrant being examined. Negative (or 0) values simply set the boundary without changing the current location. For instance, if you want to set DataMapper record boundaries whenever the phrase "Invoice Total" appears in a specific region of the page. However, the PDF file has already been padded with blank pages for duplexing purposes. The boundary should therefore be placed at the end of the page where the match is found if that match occurs on an even page, or at the end of the next blank page, if the match occurs on an odd page. Recall that for PDF files, the natural delimiter is a PDF page. The JavaScript code would look something like the following:
The above code could be completely rewritten as:
if(boundaries.find("Invoice Total",region.createRegion(150,220,200,240).found) { (boundaries.currentDelim % 2) !=0 ? boundaries.set(1): boundaries.set(); } |
|