Lifecycle DocScript Functions in v4.6

Building Lifecycle Applications for v4.5 and v4.6



Adobe PDF Documents Functions

Function Description
[PDF.PSToPDF](filename) Converts PostScript to PDF and is primarily used with the Virtual Print Driver as all documents are sent as a PostScript file. filename - Typically this would be the filename of the current document

{fdocname}.

[PDF.ConvertToTIF](filename, multipage, compression) Converts a PDF document to a TIFF image. Allows selection for a single or multi-page TIFF and compression. Filename - Typically this would be the filename of the current document {fdocname}. multipage -

Either true (single-page) or false multi-page. compression - Details the compression method for the target tiff file.

  • 1 - No compression
  • 2 - CCITTRLE
  • 3 - CCITTFAX3
  • 4 - CCITTFAX4
  • 5 - LZW
  • 7 - JPEG
  • PACKBITS- 32773
[PDF.ConvertToTIFEX](filename, outputfilename, username, password, xres, yres, bitcount, compression, quality, multipage, firstpage, lastpage) Provides an advanced platform for PDF to TIFF conversion.
  • filename - Typically this would be the filename of the current document {fdocname}.
  • outputfilename - TIF output filename
  • username - If PDF is protected the user name
  • password - if PDF is protected the password
  • xres - Horizontal output resolution of the TIF in DPI
  • yres - Vertical output resolution of the TIF in DPI
  • bitcount - Color bit depth of TIF file. 0 is black and white.
  • compression - Compression type of TIF file (see above)
  • quality - Quality of compression 0-100. (100% is no compression)
  • grayscale - 1 for grayscale, 0 for color
  • multipage - 1 for multi-page TIF, 0 for single page
  • firstpage, - Start page in PDF file to export to TIF. '1-' implies to export from the start of the document.
  • lastpage - Last page in PDF to export to.'-1' implies export to the end of the document.
[PDF.AddText](filename, textstring, position, color) Adds a text stamp to the PDF document. Filename - Typically this would be the filename of the current document {fdocname}. textstring - The text that needs to be added to the PDF. Position - The position on the PDF.
  • Default = 0
  • Top Left = 1
  • Top Center = 2
  • Top Right = 3
  • Right Center = 4
  • Right Bottom = 5
  • Bottom Center = 6
  • Left Bottom = 7
  • Left Center = 8
  • Center = 9

Color is represented in hex as shown below:

  • Red is 255. (x0000FF)
  • White is 0. (x000000)
  • Black is 16777215. (xFFFFFF)
  • Blue is 16711680. (xFF0000)
  • Green is 65280. (x00FF00)
[PDF.Split](filename, output folder name) This is used in conjunction with docpages. The pages are split into separate files into the output folder name with the original filename appended with _<page no> (e.g. _1, _2 _3…._n). Filename - Typically this would be the filename of the current document {fdocname}. Output folder name - A path for the target PDF file..
[PDF.Split](filename, output file name, pages) This is used in conjunction with docpages. The pages variable allows a specific page range to be extracted from the original documents and split into page files. Filename - Typically this would be the filename of the current document {fdocname}. Output folder name - A path for the target PDF file. Pages - The range of pages to split.
  • 2- : Will extract page 2 onwards
  • -2 : Will extract everything up to page 2
  • 1-10 : Will extract pages 1 to 10
  • 2 : Extracts page 2
[PDF.Split](filename) This is used in conjunction with docpages. The pages are split into the same folder with the original filename appended with _<page no> (e.g. _1, _2 _3…._n).
[PDF.Combine](destination filename, filename1, filename2….filename n) Combines PDF documents together. This function combines all the files specified to the file specified in filename. The filename variable can also contain a page range within the PDF. In this instance the filename1 would become an array where the first position is the filename and the subsequent elements:
  • 2- : Will extract page 2 onwards
  • -2 : Will extract everything up to page 2
  • 1-10 : Will extract pages 1 to 10
  • 2 : Extracts page 2
[PDF.NoOfPages](filename) Returns the number of pages in the specified PDF filename.filename - Typically this would be the filename of the current document {fdocname}
[PDF.GetText](filename, textmode, pages) Retrieves the text from a PDF file. Filename - Typically this would be the filename of the current document {fdocname}. Textmode - The textmode defines how the pages are returned. The default is false which returns the text as a string. Setting the textmode to true returns the text in an array, an element for each page. Pages - The pages variable allows a specific page range to be referenced:
  • 2- : Will extract page 2 onwards
  • -2 : Will extract everything up to page 2
  • 1-10 : Will extract pages 1 to 10
  • 2 : Extracts page 2
[PDF.SaveText](filename, textfilename, pages) The performs a similar function to GetText, except all the text is saved to the specified textfilename. The textfilename and pages are optional. If not specified then the textfilename will be the original PDF filename with the extension replaced to .txt. The pages defaults to all pages. Pages - The pages variable allows a specific page range to be referenced:
  • 2- : Will extract page 2 onwards
  • -2 : Will extract everything up to page 2
  • 1-10 : Will extract pages 1 to 10
  • 2 : Extracts page 2
[PDF.Repair](filename, destination filename) This function repairs the structure of a PDF file. Filename - Typically this would be the filename of the current document {fdocname}. Destination filename - The destination filename of the repaired PDF file.
[PDF.Break](filename, arrayofpagestobreakon, IncludeBreakPage) Returns an array of pages that determine where the breaks are in the document.

Adobe PDF Forms Functions

Function Description
[PDF.GetFieldNames](filename) Returns array of field names.
[PDF.GetFieldValues](filename) Returns array of field values corresponding to field names returned from GetFieldNames.
[PDF.GetFieldValue](filename, fieldname) Returns field value for the field name passed in the fieldname parameter.

Microsoft Excel Documents (via Excel Library) Functions

Function Description
[Excel.GetExcelFile]() Returns the file name that will be used.
[Excel.SetExcelFile](filename) Sets the file name that will be used (Required).
[Excel.Open](filename) Sets and opens the file. (Optional).
[Excel.Close]() Closes the file after use. (Required).
[Excel.TotalWorksheets]() Returns the number of worksheets in the Excel file.
[Excel.UsedRows](WorksheetNumber) Returns the number of used rows within the specified worksheet.
[Excel.UsedColumns](WorksheetNumber) Returns the number of used columns within the specified worksheet.
[Excel.GetCell](CellIndex,WorksheetNumber) Returns the value of a specific cell in a specified worksheet.

Microsoft Excel Documents (via OLE DB) Functions

Function Description
[Excel.Open](filename, version) Opens the excel file to be read. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0’.
(filename)
[Excel.Close]() Closes the currently opened Excel spreadsheet. (Only one can be open at a time).
[Excel.WorksheetCount](filename, version) Returns the number of worksheets in the excel file. If file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0’.
[Excel.RowCount](worksheetname, filename, version) Returns the number of used rows in a worksheet. If file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0’.
[Excel.ColumnCount](worksheetname, filename, version) Returns the number of used columns in a worksheet. If file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0’.
[Excel.CellValue](cell, worksheetname, filename, version) Returns the value at the cell (A1,B5 etc) on the worksheet. If file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0'.
[Excel.CellRange](cellstart, cellend, worksheetname, filename, version) Returns a multi-dimensional array of values between the start cell (A1,B5 etc) and the end cell on the worksheet. The start cell should be the top left of the range; the end cell should be the bottom right of the range. If file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0'.
[Excel.Query](query,filename,version) Executes the query (eg. Select * from [sheet1$]) and returns a multi-dimensional array of results. If the file is already opened filename is optional. Version is optional. Values are ‘5.0’,’6.0’,7.0’,’8.0’. Default is ‘8.0’.

Microsoft Word Documents Functions

Function Description
[Word.GetWordFile]() Returns the file name that will be used.
[Word.SetWordFile](filename) Sets the file name that will be used. (Required).
[Word.Open](filename) Sets and opens the file. (Optional).
[Word.Close]() Closes the file after use. (Required).
[Word.TotalPages]() Returns the number of pages in the Word file.
[Word.GetSinglePage](pagenumber) Returns the content of a specific page.
[Word.GetAllPages]() Returns the content of all pages.

Text Document Functions

Function Description
[Text.GetTextFile]() Returns the file name that will be used.
[Text.SetTextFile](filename) Sets the file name that will be used. (Required).
[Text.Close]() Closes the file after use. (Required).
[Text.GetAllText]() Returns all the text in the file.
[Text.GetText](startpos,count) Returns a portion of the text file, specifying the start position and number of characters.
[Text.TotalChars]() Returns the total number of characters in the text file.

Barcode Functions

Function Description
[Barcode.IsValidFileFormat](filenameext) Checks whether the file extension is a valid format. DocScript can read barcodes on either TIFF or PDF images files.
[Barcode.ReadPatch](boolval) Set the barcode type as a patch code.PatchCode.JPG
[Barcode.ReadCode11](boolval) Sets the barcode type as Code 11.Code11.JPG
[Barcode.ReadCode39](boolval) Sets the barcode type as Code 39.code39.jpg
[Barcode.ReadCode128](boolval) Sets the barcode type as Code 128.code128.jpg
[Barcode.ReadCodaBar](boolval) Sets the barcode type as CodaBar. codabar.jpg
[Barcode.ReadInter2of5](boolval) Sets the barcode type as Inter2of5.
[Barcode.ReadEAN13](boolval) Sets the barcode type as EAN13.EAN13.jpg
[Barcode.ReadEAN8](boolval) Sets the barcode type as EAN8.EAN8.jpg
[Barcode.ReadUPCE](boolval) Sets the barcode type as UPCE.
[Barcode.ReadAdd2](boolval) Sets the barcode type as Add2.
[Barcode.ReadPDF417](boolval) Sets the barcode type as PDF417.PDF417.jpg
[Barcode.ReadDataMatrix](boolval) Sets the barcode type as Data Matrix.DataMatrix.jpg
[Barcode.ReadQRCode](boolval) Sets the barcode type as QR Code.QRCode.jpg
[Barcode.SetAllFormatsTo](boolval) Sets all formats to be read. Care must be taken when using this option as it will reduce performance.
[Barcode.ScanRight](boolval) Scans barcode from right to left of the page.
[Barcode.ScanLeft](boolval) Scans barcode from left to right of the page.
[Barcode.ScanUp](boolval) Scans barcode from the bottom to the top of the page.
[Barcode.ScanDown](boolval) Scans barcode from the top to the bottom of the page.
[Barcode.ThresholdLevel](intval) Default to 0, variation in the accuracy of the scan.
[Barcode.ScanInterval](intval) Used in conjunction with Threshold and determines the scan interval.
[Barcode.SetReadArea](X,Y,Width,Height) Sets the scan area of a barcode. This is used if the process is picking up other barcodes on the page. This function specifies a specific area to read the barcode. Parameter values are in pixels.
[Barcode.BarcodesToRead](numberofbarcodestoread) Sets the number of barcodes to read.
[Barcode.SetAllDirectionsTo](boolval) Sets all directions. Care must be taken when using this option as it will reduce performance.
[Barcode.Read](filename) Reads the barcode once the rules are set.
[Barcode.SetDespeckle](value)   Set value to 1 to despeckle each page before detecting barcodes. Set value to 0 to not despeckle. The default is 0. Warning: May improve detection percentage on degraded images, but will decrease recognition speed.
[Barcode.SetDilate](value) Set value to 1 to dilate each page before detecting barcodes. Set value to 0 to not detect. The default is 0. Warning: May improve detection percentage on degraded images, but will decrease recognition speed.
[Barcode.SetErode](value) Set value to 1 to erode edges on each page before detecting barcodes. Set value to 0 to not erode edges. The default is 0. Warning: May improve detection percentage on degraded images, but will decrease recognition speed.
[Barcode.SetInvert](value) Set value to 1 to invert each page before detecting barcodes. Set value to 0 to invert. The default is 0. Warning: May improve detection percentage on degraded images, but will decrease recognition speed.
[Barcode.SetSharp](value) Set value to 1 to sharpen each page before detecting barcodes. Set value to 0 to not do this. By default is 0. Warning: May improve detection percentage on degraded images, but will decrease recognition speed.
[Barcode.SetRenderMode] (value, dpi) Set value to ‘RENDER’ to re-render each page at the dpi specified. This may improve detection performance if the page image dpi is less than 200dpi. Set value to ‘IMAGE’ to use the page image. In ‘IMAGE’ mode dpi is ignored. The render mode is set to ‘IMAGE’ by default. Warning: ‘RENDER’ mode is slower that ‘IMAGE’ mode.
[Barcode.SetFilter](filter1,….,filterN) Set one or more regex filters. Barcode.GetPages will only return barcodes whose contents match one or more of the filters.
[Barcode.AddFilter](filter1,….,filter) Add one or more regex filters. Barcode.GetPages will only return barcodes whose contents match one or more of the filter.
[Barcode.ClearFilter]() Remove all barcode regex filters.

TIFF Image Processing Functions

Function Description
[TIFF.Split](filename) Splits to the TIFF file and returns an array of filenames for each page. The tiff files will be in the same location as the original TIFF capture.
[TIFF.AddText](filename, text, leftoffset, bottomoffset) Allows text to be added to TIFFs.
[TIFF.AddText](filename, text, leftoffset, bottomoffset, textcolor) Allows text to be added with color (only applies to color TIFFs). Color can be an int or a string. If a string can be a color name (eg. red) OR 'r,g,b' integers.
[TIFF.AddText](filename, text, leftoffset, bottomoffset, textcolor, textfont) Allows font to also be added.
[TIFF.Combine](inputfilenames, outputfilename, byteorder) Combines TIFF pages together. Uses byteorder 0 = Intel, all others are Motorola.
[TIFF.TIFtoPDF](tiff filename) Returns the name of the converted PDF file.
tiff filename - The name of the source TIFF file.

OCR Processing Functions

Function Description
[PIOCR.ToText](filename, includepages, textfileformat, textfilename) OCR's an image file, which can be a PDF image, TIFF or a bitmap image..
  • Filename - Typically this would be the filename of the current document {fdocname}.
  • Includepages denotes which pages to be OCR'd and is represented as below:
    • 2- : Will extract page 2 onwards
    • -2 : Will extract everything up to page 2
    • 1-10 : Will extract pages 1 to 10
    • 2 : Extracts page 2
  • Textfileformat indicates the output either:
    • text - A text file.
    • word - Microsoft Word
    • wp - Word Perfect
    • rtf - Rich Text Format
    • html - HTML

Note, the default is text

  • Textfilename - This denotes the output file. If blank (ie. ‘’) the filename will be used and replace with a appropriate extension.
[PIOCR.ToPDF](filename, pdffilename, includepages, ocrpages, separatetextfile, imageandtext) OCR's an image file, which can be a PDF image, TIFF or a bitmap image..
Filename - Typically this would be the filename of the current document {fdocname}.
  • Includepages denotes which pages to be included in the output PDF and is represented as below:
  • 2- : Will extract page 2 onwards
    • -2 : Will extract everything up to page 2
    • 1-10 : Will extract pages 1 to 10
    • 2 : Extracts page 2
  • Ocrpages denotes which pages to be OCR'd and is represented as below:
    • 2- : Will extract page 2 onwards
    • -2 : Will extract everything up to page 2
    • 1-10 : Will extract pages 1 to 10
    • 2 : Extracts page 2
  • Separatetextfile indicates the output either:
    • text - A text file.
    • word - Microsoft Word
    • wp - Word Perfect
    • rtf - Rich Text Format
    • html - HTML
    • Note, the default is text
  • Imageandtext - True will make the output PDF image plus text as an overlay

Note, the process automatically adds the Adobe Web View tags for faster web viewing.

[PIOCR.EnableWebView](filename) Filename - Typically this would be the filename of the current document {fdocname}.
Note, the process automatically adds the Adobe Web View tags for faster web viewing.
[PIOCR.Combine]({destpdffilename},{sourcepdffilename1},{sourcepdffilename2}) Combines 2 PDF files into one. The destination file name can be the same as one of the source file names.
[PIOCR.GetText](pdffilename, pagnos, pagesinarray) Extracts the text of an image.
  • pdffilename - Retrieves the text from a PDF file.
  • pagenos - Returns text from the pdffilename page.

Text from a page is returned in one line.
If no pageno is supplied then all pages are returned.

  • {pagenos} is a string. Can be used to set a range of pages, or individual pages.
    • 2- : Will extract page 2 onwards
    • -2 : Will extract everything up to page 2
    • 1-10 : Will extract pages 1 to 10
    • 2 : Extracts page 2
  • {pagesinarray} is a boolean. If true will return an array, with each element as text from each page. If false will return all text in a single string, with pages separated by a CRLF.
[PIOCR.CompressAllPages](value) If true will compress all pages in the PDF output file. If false will use original PDF document pages when the page is not OCR'd or rotated. Is false by default. TIF file pages are always compressed.
[PIOCR.UseLossyJBIG](value) Boolean value, either true or false to use "lossy" JBIG. Lossy JBIG improves compression be about 2-10% per page but is not 100% compatible with Acrobat 7 and below. False by default.
[PIOCR.UseFastOCR](value) True or false to use fast, but less accurate OCR. False by default.
[PIOCR.UseAutoRotate](value) True or false to auto-rotate pages. True by default.
[PIOCR.UseAutoDeskew](value) True or false to auto-deskew pages. False by default.
[PIOCR.SetDPIs](ocrdpi,compressimagedpi) Used to set the OCR dpi (300 by default). Recommended not to use less than 150. 300 DPI combined with the built-in image compression provides high accuracy and small PDF size. The compressimagedpi parameter is the DPI to use when compressing large color depth images. Default is 200 DPI.
[PIOCR.RemoveBlankPages](value) If value is set to 1, PIOCR.ToPDF will remove blank pages, else it will not. By default, RemoveBlankPages is set to 0.
[PIOCR.SetMarkedAsProcessed](value) If value is true the process will “mark” in the PDF metadata when a PDF file has been processed by PIOCR.ToPDF. By default is true.
[PIOCR.SetIgnoreProcessed](value) If value is true ToPDF will not process a file if it has been marked in the meta data as already processed by ToPDF. By default is true.
[PIOCR.SetKeepOriginalText](value) If value is true, ToPDF will not re-OCR pages that already have text. By default is true.
[PIOCR.SetKeepColorSplashes](value) If value is true, ToPDF will not turn color splashes to gray, when compressing PDF files. By default is false. Turning color splashes (highlights and pen marks) to gray can reduce the page image size by a factor of 5.

Database Functions

Function Description
[Access.Open](filename) Opens the access file to be read.
[Access.Close]() Closes the currently opened access database file.
[Access.Query](query, filename) Executes the query (e.g. Select * from [Customers] and returns a multi-dimensional array of results. The filename parameter is optional if the Access database is already opened by using the [Access.Open] function.
[ODBC.Open](connectionstring) ODBC database connection using the connection string. Eg. “dsn=….;Uid=….;Pwd=…”.
[ODBC.Close]() Closes the currently opened ODBC database connection.
[ODBC.Query](query, connectionstring) Executes the query (eg. Select * from Customers) and returns a multi-dimensional array of results. If the connection is already opened connectionstring is optional.
[SQL.Open](connectionstring) Opens an SQL server database connection using the connection string. Eg. “datasource=….;User=….;Password=…..;IntialCatalog=….”.
[SQL.Close]() Closes the currently opened SQL server database connection.
[SQL.Query](query, connectionstring) Executes the query (eg. Select * from Customers) and returns a multi-dimensional array of results. If the connection is already opened connectionstring is optional.

Database Lookups Functions

The database lookups are performed automatically once setup in the index configuration data source tab.


File Analysis Functions

Function Description
[File.FullName](filename) Returns the full filename (path, filename and extension).
[File.Length](filename) Returns the number of bytes in the file.
[File.Name](filename) Returns the name of the file without the path, but with the extension.
[File.IsPowerPoint](filename) Returns True if the file is a Microsoft PowerPoint file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsWord](filename) Returns True if the file is a Microsoft Word file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsExcel](filename) Returns True if the file is a Microsoft Excel file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsPDF](filename) Returns True if the file is a Adobe PDF file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsTIF](filename) Returns True if the file is a TIFF image file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsTxt](filename) Returns True if the file is a Text file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsPS](filename) Returns True if the file is a PostScript or Encapsulated PostScript file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsXML](filename) Returns True if the file is an XML file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsHTML](filename) Returns True if the file is an HTML file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsJPG](filename) Returns True if the file is a JPEG image file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsGIF](filename) Returns True if the file is a GIF image file. Does not use the file extension. Instead it analyzes the files contents.
[File.IsRTF](filename) Returns True if the file is a Rich Text Format file. Does not use the file extension. Instead it analyzes the files contents.

Files and Directory Functions

Function Description
[File.Copy](sourcefile, destinationfile, overwrite) File copy function. The overwrite variable is optional, by default it is True.
[File.Exists](filename) Determine whether a file exists. Returns True or False.
[File.Move](sourcefile, destinationfile) Moves a file from the source to destination locations.
[File.Replace](sourcefile, destinationfile, backupfilename, ignoremetadataerrors) IgnoreMetadataErrors is optional, by default it is True.
[File.Delete](filename) Deletes specified file.
[File.DirectoryName](filename) Returns files directory path.
[File.Extension](filename, ignoreextenstion) Returns the files extension. eg ".tif" ".pdf". IgnoreExtension is optional, by default it is False. If True the function will analyze the file contents to determine the extension.
[File.Length](filename) Returns the length of the filename.
[File.Name](filename) Returns the filename, removing the path.
[File.NameWoExt(filename) Returns the name of the document without the path and extension.
[File.ReadAllBytes(filename) Reads the contents of file (binary).
[File.ReadAllLines(filename) Returns an array of lines.
[File.ReadAllText(filename) Returns a string of text.
[File.WriteAllLines(filename, lines) Writes all lines in an array of lines.
[File.WriteAllText(filename, textstring) Write a string of text.
[File.AppendAllText(filename, textstring) Appends the text to the specified file.
[Dir.Create](directoryname) Creates a directory.
[Dir.Exists](directoryname) Returns True if the directory exists, otherwise returns False.
[Dir.GetDirectories](directoryname) Returns an array of subdirectories below the directoryname directory.
[Dir.GetDirectories](directoryname,SearchPattern) Returns an array of subdirectories below the directoryname directory that match the search pattern.
[Dir.GetDirectories](directoryname,SearchPattern,All) Returns an array of subdirectories below the directoryname directory that match the search pattern. If All is true will below the top-level subdirectories, otherwise will only search in the top-level.
[Dir.GetFiles](directoryname) Returns an array of files below the directoryname directory.
[Dir.GetFiles](directoryname, searchpattern) Returns an array of files below the directoryname directory that match the searchpattern.
[Dir.GetFiles](directoryname, searchpattern, all) Returns an array of files below the directoryname directory that match the searchpattern. If All is True will below the top-level files, otherwise will only search in the top-level.
[Dir.Move](sourcedirectory, destinationdirectory) Moves a directory and its contents to the destination.

Regular Expression Functions

Function Description
[Regex.GetSearchString]() Retrieves the search string.
[Regex.SetSearchString](searchstring) Sets search string.
[Regex.GetRegex]() Evaluates the string passed against the regular expression.
[Regex.CheckForValue](anchor, location, charactercount) Finds a string in the searchstring. The anchor provides the search starting point, location determines whether to look before or after, charactercount indicates the number of characters to check. Returns True if matched, or False if no match found.
[Regex.CheckForRange](startanchor, endanchor) Checks the searchstring within a given range determined by the startanchor and endanchor. Returns True if matched, or False if no match found.
[Regex.GetValue](anchor, location, charactercount) Finds a string in the searchstring. The anchor provides the search starting point, location determines whether to look before or after, charactercount indicates the number of characters to check. Return the first matched string.
[Regex.GetValues](anchor, location, charactercount) Finds a string in the searchstring. The anchor provides the search starting point, location determines whether to look before or after, charactercount indicates the number of characters to check. Returns all matched strings in an array.
[Regex.GetRange](startanchor, endanchor) Checks the searchstring within a given range determined by the startanchor and endanchor. Returns the first matched string.
[Regex.GetRanges](startanchor, endanchor) Checks the searchstring within a given range determined by the startanchor and endanchor. Returns the matched strings in an array.
[Regex.GetValueFromRegex](regularexpression, igroup) Assign the regular expression code, returns string.
[Regex.GetValuesFromRegex](regularexpression, igroup) Assign the regular expression code, returns array.

String Functions

Function Description
[String.Split](sourcestring, splitstring, removeemptyvalues) Splits a string into an array. If the third parameter is set to true then blank values will be removed from the array.
[String.Length](sourcestring) Returns the length of a string.
[String.Substring](sourcestring, startpos, length) Returns a sub-string based on the start position and the length.
[String.Substring](sourcestring, startpos) Returns a sub-string based on the start position to the end of the string.
[String.Trim](sourcestring) Trims the string.
[String.LTrim](sourcestring) Trims the values to the left of the string.
[String.RTrim](sourcestring) Trims the values to the right of the string.
[String.ToUpper](sourcestring) Converts string to upper case.
[String.ToLower](sourcestring) Converts string to lower case.
[String.Item](sourcestring,index) Returns a character out of a string based on the position.
[String.IndexOf](sourcestring, searchstring, startpos) Returns a characters out of a string based on a search string at the specified start position.
[String.IndexOf](sourcestring, searchstring) Returns a characters out of a string based on a search string from the beginning of the string.
[String.Contains](sourcestring, searchstring) Returns true or false if the string contains the search string.
[String.FindBetween]
[String.FindBetween](searchstring, starttoken, endtoken, recurse)
[String.FindBetween](searchstring, starttoken, endtoken)
Extracts one or more strings that are found in between the start and end token. For example, if the search string is *The dog said, "Woof"*, and the starttoken and endtoken are " and ", then FindBetween

would return *Woof*. If recurse is true it will search the whole searchstring and return all instances in an array. If securse is false it will only return the first instance. If no instances are found it will return "" or an empty array.

[String.ContainsNumeric](searchstring) Returns true if the string contains any numeric number (0-9)..
[String.ContainsAlpha](searchstring) Returns true if the string contains any alpha character (a-z;A-Z).
[String.ToSSN](ssnwithnodashes) Takes a 9 digit SSN and reformats it to contain dashes. eg. If input is 123456789, it will return 123-45-6789.
[String.Replace](string, oldvalue, newvalue) Replaces the oldvalue with the newvalue in string.
[String.PadLeft](string, totalwidth, paddingchar) Pads the string from the left with paddingchar for the totalwidth.
[String.PadRight](string, totalwidth, paddingchar) Pads the string from the right with paddingchar for the totalwidth.
[String.MakeFilename](string) Remove illegal filename chars and replaces them with tags.
[String.UnMakeFilename](string) Add the illegal filename chars and replaces them with the original characters.
[String.PadDecimal](value) Will return the decimal string value padded with 2 decimal places. Eg. 10 will return 10.00. 5.5 will return 5.50. 6.78 will return 6.78.
[String.PadDecimal](value, numdecimalplaces) Return the decimal string value padded with numdecimalplaces decimal places.
[String.HighestNumber](values1, …., valuesN) Will return the highest number in the parameters. There must be at least one parameter. A parameter can be an array or a single value.
[String.LowestNumber](values1, …., valuesN) Will return the lowest number in the parameters. There must be at least one parameter. A parameter can be an array or a single value.
[String.SplitPages](pagetext) Will split an OCR text file, generated by PIOCR.ToPDF, into an array of pages.
[String.Combine](delimiter ,values1,….,valuesN) Will return the combination of the value parameters, separated by delimiter. Each value parameter can be a single value or an array. Eg. [String.Combine](‘|’,’10’,’20’,’30’) will return 10|20|30.
[String.FindAround](text, findtag) Will search text for findtag. If findtag is found it will return a block of text, around findtag, 2 lines above and two lines below. It will return the first block it finds.
[String.FindAround](text, findtag, linesabovetag, linesbelowtag, charactersleft, charctersright, recurse) Will search text for findtag. If findtag is found it will return a block of text, around findtag, of the dimensions:
  • linesabovetag lines above;
  • linesbelowtag lines below;
  • charactersleft to the left of the tag;
  • charactersright to the right of the tag. If charactersleft is -1, then the block will go to the start of the line. If charactersright is -1, then the block will go to the end of the line.
[String.FindAround](text, findtag, linesabovetag, linesbelowtag, charactersleft, charctersright, recurse) Will search text for findtag. If findtag is found it will return a block of text, around findtag, of the dimensions:
  • linesabovetag lines above;
  • linesbelowtag lines below;
  • charactersleft to the left of the tag;
  • charactersright to the right of the tag. If charactersleft is -1, then the block will go to the start of the line. If charactersright is -1, then the block will go to the end of the line. If recurse is 1 then it will return an array of blocks for each findtag in text. If recurse is 0 then it will return the first block it finds.

Processing Templates

Function Description
[DocuNECT.FindAllTemplates]({PageTextArray}) A page array of all text in the document is passed into this command as a parameter. This command is used in conjunction with the templates feature of the editor (v4.1.1.11 and above). Once the templates have been setup in the editor, calling this command will:
  • Search the pages for the values setup in the Primary, Secondary and Tertiary tags
  • Once the template as been identified the business rules are applied to set the index values for the document.
  • The command returns an array of pages where the templates tags were found.
[DocuNECT.FindTemplate]({PageTextArray}, {TemplateName}) The same as the previous command, however, this command finds a specific template. There are two parameters the page text array and the name of the template to find.

Array Functions

Function Description
[DocuNECT.SetVar](varname, varvalue, indexno) Sets the array element variable with the name of varname, at the position of indexno, to the value of varvalue.
Support multi-dimensional arrays:
[DocuNECT.SetVar](varname, varvalue, indexnoA,indexnoB,….indexnoZ)
[DocuNECT.SetVar](varname, varvalue) Sets the variable with the name of varname, to the value of varvalue.
Supports multi-dimensional arrays:
[DocuNECT.GetVar](varname, indexnoA,indexnoB,….indexnoZ).
[DocuNECT.GetVar](varname) Returns the variable named varname.
[DocuNECT.GetVar](varname, indexno) Returns the array element variable named varname, at the position of indexno.

Date/Time Functions

Function Description
[DateTime.Year]() Returns the current year.
[DateTime.Month]() Returns the current month. 1 - 12.
[DateTime.DOM]() Returns the current day of the month. 1 - 31.
[DateTime.DOY]() Returns the current day of the year. 1 - 365.
[DateTime.DOW]() Returns the current day of the week. (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday).
[DateTime.Hour]() Returns the current hour. 0 - 23.
[DateTime.Minute]() Returns the current minute. 0 - 59.
[DateTime.Second]() Returns the current second. 0 - 59.
[DateTime.Millisecond]() Returns the current millisecond. 0 - 999.
[DateTime.Ticks]() Returns the current tick on the PC.
[DateTime.Now]() Returns the current date and time as a string. (Month/Day/Year Hour:Minute:Second).
[DateTime.Today]() Returns the current date as a string: Month/Day/Year.
[DateTime.TimeOfDay]() Returns the current time as a string: Hour:Minute:Second.
[DateTime.UTCNow]() Returns the current UTC date and time as a string: Month/Day/Year Hour:Minute:Second.
[DateTime.ReformatDateTime](datetimestring, newformat) Will convert the datetimestring to the new format.
Note You can use any custom .NET style date and time format string. See http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx for more information.
[DateTime.ReformatDateTime](datetimestring, oldformat, newformat) Will convert the datetimestring which uses the old format to the new format.
Note You can use any custom .NET style date and time format string. See http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx for more information.
[DateTime.Compare]({date1},{date2}) Returns 0 if dates are the same; -1 if date1 is earlier; +1 if date1 is later.
[DateTime.Same]({date1},{date2}) Returns 0 if the dates are tge same; -1 if date1is earlier; +1 if date1 is later.
[DateTime.Earlier]({date1},{date2}) Returns 0 if date1 is later; 0 if both the same; 1 if date1 is earlier.
[DateTime.Earlier]({date1},{date2}) Returns 0 if date1 is later; 0 if both the same; 1 if date1 is earlier.
[DateTime.EarlierOrSame]({date1},{date2}) Returns 0 if date1 is later; 1 if both the same; 1 if date1 is earlier.
[DateTime.Later]({date1},{date2}) Returns 1 if date1 is later; 0 if both the same; 0 if date1 is earlier.
[DateTime.LaterOrSame]({date1},{date2}) Returns 1 if date1 is later; 1 if both the same; 0 if date1 is earlier.

User and Role Routing Functions

Function Description
{docusername} Used to route specific documents to a user. {docusername} = '<username>'.
{docrolename} Used to route specific documents to a user role. {docrolename} = '<rolename>.

Email Functions

Function Description
{docusername} Used to route specific documents to a user. {docusername} = '<username>'.
[Email.Send](To, Message, Subject, Attachments, From, CC, Bcc)
  • To – Who to send the email to. To specify more than one address use an array or one string with each address delimited by a semi-colon. This parameter is required.
  • Message – The message body. Must be a string. This parameter is required.
  • Subject – The subject header of the email. This parameter is required.
  • Attachments – List of file file paths to attach to the email. If more than one attachment can use an array or one string with each attachment path delimited by a semi-colon. This parameter is optional.
  • From – The address of the sender. This parameter is optional and if not used, the sender will be the cmsadmin email address..
  • CC - Who to cc the email to. If more than one address can use an array or one string with each address delimited by a semi-colon. This parameter is optional.
  • Bcc - Who to bcc the email to. If more than one address can use an array or one string with each address delimited by a semi-colon. This parameter is optional.

This function will use the SMTP server defined in the DocuNECT Web Properties.