Bates (Page/Document) Numbering Commands

Bates numbering (also called Bates stamping) is used to number and/or date/time stamp images and documents for future reference. Typically this would be done as and when images and documents are received.

This is mainly used by businesses for identifying receipts and orders and is used extensively by the legal profession when evidence/exhibits must be numbered during the "discovery stage" of preparations for legal action.

There is no standard format for a Bates number although it is common to use 8, 9 or 10 digit numbers with additional identifying text (usually a short identifying prefix or suffix). The Bates number can either uniquely identify every page of every document (with the Bates number incrementing with every page) or just uniquely identify every document (with the Bates number incrementing with every document).

  I2PDF_BatesFormat
Parameters: format - text (up to 100 characters) with any combination of special formatting markup characters:
  • BN-B to BN-BBBBBBBBBB inserts the current Bates number, with the number of B's representing the number of leading zeroes that will pad the displayed Bates number if it is less than the number of B's indicated. If you specify a smaller number of digits, eg BBBB, than the actual number, eg 50423, then the full Bates number will be displayed in it's entirety.
  • PG-P to PG-PPPP inserts the current page number of the PDF, with the number of P's representing the number of leading zeroes that will pad the displayed page number if it is less than the number of P's indicated. If you specify a smaller number of digits, eg PP, than the actual number, eg 132, then the full page number will be displayed in it's entirety.
  • DT-DD, DT-D inserts the current day of the month (1 to 31), with the number of D's representing the number of leading zeroes that will pad the displayed day number if it is less than the number of D's indicated. If you specify a smaller number of digits, eg D, than the actual number, eg 12, then the full day number will be displayed in it's entirety.
  • DT-Day, DT-DAY, DT-Dy, DT-DY inserts the name of the current day of the week, eg DT-Day=Monday, DT-DAY=MONDAY, DT-Dy=Mon and DT-DY=MON. Note: The actual full and abbreviated day names are retrieved from the current system locale information, if this is not available then it reverts to the English names.
  • DT-MM, DT-M inserts the current month in the year (1 to 12), with the number of M's representing the number of leading zeroes that will pad the displayed month number if it is less than the number of M's indicated. If you specify a smaller number of digits, eg M, than the actual number, eg 11, then the full month number will be displayed in it's entirety.
  • DT-Month, DT-MONTH, DT-Mon, DT-MON inserts the name of the current month of the year, eg DT-Month=January, DT-MONTH=JANUARY, DT-Mon=Jan and DT-MON=JAN. Note: The actual full and abbreviated month names are retrieved from the current system locale information, if this is not available then it reverts to the English names.
  • DT-YEAR, DT-YY inserts the current year, eg DT-YEAR=2007, DT-YY=07.
  • TM-HH, TM-H inserts the current hour of the day (0 to 23), with the number of H's representing the number of leading zeroes that will pad the displayed hour number if it is less than the number of H's indicated. If you specify a smaller number of digits, eg H, than the actual number, eg 19, then the full hour number will be displayed in it's entirety.
  • TM-Hh, TM-h inserts the current hour of the day (0 to 12, values larger than 12 wrap around to 1, so 13 becomes 1, 14 becomes 2 etc), with the number of H's representing the number of leading zeroes that will pad the displayed hour number if it is less than the number of H's indicated. If you specify a smaller number of digits, eg H, than the actual number, eg 10, then the full hour number will be displayed in it's entirety.
  • TM-AMPM, TM-ampm inserts either AM/am or PM/pm depending on the current hour in the day, 0-11=AM, 12-23=PM.
  • TM-MM, TM-M inserts the current minute of the hour (0 to 59), with the number of M's representing the number of leading zeroes that will pad the displayed minute number if it is less than the number of M's indicated. If you specify a smaller number of digits, eg M, than the actual number, eg 53, then the full minute number will be displayed in it's entirety.
  • TM-SS, TM-S inserts the current second of the minute (0 to 59), with the number of S's representing the number of leading zeroes that will pad the displayed second number if it is less than the number of S's indicated. If you specify a smaller number of digits, eg S, than the actual number, eg 27, then the full second number will be displayed in it's entirety.
  • Return Value: 0 - success
    1 - invalid format
    Notes:
  • You don't have to specify any of the special markup formatting above, you could just have your company name, a copyright message or some general text (eg DRAFT, CONFIDENTIAL etc).
  • If you just want each page numbered then just use PG-P.
  • You can create quite complex "Bates" numbers, eg "(c) Acme DT-YEAR, BN-BBBBBBBBBB-PG-PPPP [DT-MM/DT-DD/DT-YY TM-HH:TM-MM:TM-SS]" would appear as "(c) Acme 2007, 0001234567-0003 [01/31/07 14:06:29]"

  •   I2PDF_BatesLocation
    Parameters: verticalPosition - must be one of the following: VERTICAL_ALIGNMENT_TOP (1), VERTICAL_ALIGNMENT_MIDDLE (2) or VERTICAL_ALIGNMENT_BOTTOM (3)
    horizontalPosition - must be one of the following: HORIZONTAL_ALIGNMENT_LEFT (1), HORIZONTAL_ALIGNMENT_CENTER (2) or HORIZONTAL_ALIGNMENT_RIGHT (3)
    textOrientation - must be one of the following: 0, 90, 180 or 270.
    margin - must be between 0.0 and 100.0 points inclusive (this is not used if the alignment is VERTICAL_ALIGNMENT_MIDDLE and HORIZONTAL_ALIGNMENT_CENTER).
    Return Value: 0 - success
    1 - invalid verticalPosition
    2 - invalid horizontalPosition
    3 - invalid textOrientation
    4 - invalid margin
    Notes:
  • This is optional and specifies the location that the Bates "number" is displayed on each page of the output PDF document.
  • A margin between the Bates "number" and the edge of the page can be specified if required.
  • If you do not want the Bates "number" to obscure part of the page then use the border commands (I2PDF_Border, I2PDF_BorderLeft, I2PDF_BorderTop, I2PDF_BorderRight, I2PDF_BorderBottom, I2PDF_BorderColor) to add space around the image that the Bates "number" can be displayed within.
  • If not specified a default of VERTICAL_ALIGNMENT_BOTTOM, HORIZONTAL_ALIGNMENT_RIGHT, 0, and 0.0 are used.
  • 1 point is 1/72 inch.

  •   I2PDF_BatesLocation_Int
    Parameters: verticalPosition - must be one of the following: VERTICAL_ALIGNMENT_TOP (1), VERTICAL_ALIGNMENT_MIDDLE (2) or VERTICAL_ALIGNMENT_BOTTOM (3)
    horizontalPosition - must be one of the following: HORIZONTAL_ALIGNMENT_LEFT (1), HORIZONTAL_ALIGNMENT_CENTER (2) or HORIZONTAL_ALIGNMENT_RIGHT (3)
    textOrientation - must be one of the following: 0, 90, 180 or 270.
    margin - must be between 0 and 100 points inclusive (this is not used if the alignment is VERTICAL_ALIGNMENT_MIDDLE and HORIZONTAL_ALIGNMENT_CENTER).
    Return Value: 0 - success
    1 - invalid verticalPosition
    2 - invalid horizontalPosition
    3 - invalid textOrientation
    4 - invalid margin
    Notes:
  • This is optional and specifies the location that the Bates "number" is displayed on each page of the output PDF document.
  • A margin between the Bates "number" and the edge of the page can be specified if required.
  • If you do not want the Bates "number" to obscure part of the page then use the border commands (I2PDF_Border, I2PDF_BorderLeft, I2PDF_BorderTop, I2PDF_BorderRight, I2PDF_BorderBottom, I2PDF_BorderColor) to add space around the image that the Bates "number" can be displayed within.
  • If not specified a default of VERTICAL_ALIGNMENT_BOTTOM, HORIZONTAL_ALIGNMENT_RIGHT, 0, and 0 are used.
  • 1 point is 1/72 inch.

  •   I2PDF_BatesFont_Real
    Parameters: size - must be between 1 and 300 points inclusive.
    font - must be one of the following standard PDF fonts (which are also known as base14 fonts): Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
    fillRed - specifies the red component of the fill color. Value must be between 0.0 and 1.0 inclusive.
    fillGreen - specifies the green component of the fill color. Value must be between 0.0 and 1.0 inclusive.
    fillBlue - specifies the blue component of the fill color. Value must be between 0.0 and 1.0 inclusive.
    style - must be one of the following:
    TEXT_STYLE_NORMAL (1) - text is filled in with the required fill color
    TEXT_STYLE_STROKE (2) - text is filled in with the required fill color and the outline of each letter is "stroked" in the other color
    otherRed - specifies the red component of the "other" color. Value must be between 0.0 and 1.0 inclusive.
    otherGreen - specifies the green component of "other" color. Value must be between 0.0 and 1.0 inclusive.
    otherBlue - specifies the blue component of "other" color. Value must be between 0.0 and 1.0 inclusive.
    Return Value: 0 - success
    1 - invalid size
    2 - invalid font
    3 - invalid fillRed
    4 - invalid fillGreen
    5 - invalid fillBlue
    6 - invalid style
    7 - invalid otherRed
    8 - invalid otherGreen
    9 - invalid otherBlue
    Notes:
  • This is optional and controls the display of the Bates "number".
  • If not specified a default of 10 point Times-Roman black normal text is used.
  • Click here for more information and examples of real colors.

  •   I2PDF_BatesFont_Int
    Parameters: size - must be between 1 and 300 points inclusive.
    font - must be one of the following standard PDF fonts (which are also known as base14 fonts): Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
    fillRed - specifies the red component of the fill color. Value must be between 0 and 255 inclusive.
    fillGreen - specifies the green component of the fill color. Value must be between 0 and 255 inclusive.
    fillBlue - specifies the blue component of the fill color. Value must be between 0 and 255 inclusive.
    style - must be one of the following:
    TEXT_STYLE_NORMAL (1) - text is filled in with the required fill color
    TEXT_STYLE_STROKE (2) - text is filled in with the required fill color and the outline of each letter is "stroked" in the other color
    otherRed - specifies the red component of the "other" color. Value must be between 0 and 255 inclusive.
    otherGreen - specifies the green component of "other" color. Value must be between 0 and 255 inclusive.
    otherBlue - specifies the blue component of "other" color. Value must be between 0 and 255 inclusive.
    Return Value: 0 - success
    1 - invalid size
    2 - invalid font
    3 - invalid fillRed
    4 - invalid fillGreen
    5 - invalid fillBlue
    6 - invalid style
    7 - invalid otherRed
    8 - invalid otherGreen
    9 - invalid otherBlue
    Notes:
  • This is optional and controls the display of the Bates "number".
  • If not specified a default of 10 point Times-Roman black normal text is used.
  • Click here for more information and examples of integer colors.

  •   I2PDF_BatesFont_Web
    Parameters: size - must be between 1 and 300 points inclusive.
    font - must be one of the following standard PDF fonts (which are also known as base14 fonts): Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
    fillColor - specified as a hexadecimal string (from #000000 to #FFFFFF)
    style - must be one of the following:
    TEXT_STYLE_NORMAL (1) - text is filled in with the required fill color
    TEXT_STYLE_STROKE (2) - text is filled in with the required fill color and the outline of each letter is "stroked" in the other color
    otherColor - specified as a hexadecimal string (from #000000 to #FFFFFF)
    Return Value: 0 - success
    1 - invalid size
    2 - invalid font
    3 - invalid fillColor
    4 - invalid style
    5 - invalid otherColor
    Notes:
  • This is optional and controls the display of the Bates "number".
  • If not specified a default of 10 point Times-Roman black normal text is used.
  • Click here for more information and examples of web colors.

  •   I2PDF_BatesFile
    Parameters: filename - specifies the name and location of the file to store the Bates number in.
    Return Value: 0 - success
    1 - invalid filename
    Notes:
  • This is optional but is useful if you want to have sequential numbering continue automatically between documents.
  • If the file does not exist it will be created automatically when the first Bates "number" is output in the PDF document.
  • This file records the last used Bates number, when it is read in the number is incremented before it is used and stored back in the file.

  •   I2PDF_BatesNumber
    Parameters: value - must be a value between 0 and 4294967295 inclusive.
    Return Value: 0 - success
    Notes:
  • This is optional and defines the initial Bates number (BN-B) used.
  • If the -BatesFile command has been used (see above) and the filename specified contains a number then then this command is ignored as the next Bates number to use is based on the value in the filename give. If the file does not exist or is empty, then this value is used and will be recorded in the filename specified for later use.
  • If not specified a default value of 1 is used.

  •   I2PDF_BatesIncrement
    Parameters: value - must be between 0 and 1000000.
    Return Value: 0 - success
    1 - invalid value
    Notes:
  • This is optional and defines the amount by which the Bates number is incremented with use.
  • When the Bates number exceeds 4294967295 after being incremented it resets to start again with 1.
  • If a value of zero is used this has a special meaning in that the Bates number is not incremented per page in the PDF document but incremented by 1 each time a new PDF is created (no matter how many pages might be in the document).
  • If not specified a default value of 1 is used.

  •   I2PDF_BatesBackground_Real
    Parameters: shape - must be one of the following: BATES_BACKGROUND_FILLED_RECT (1) or BATES_BACKGROUND_OUTLINE_RECT (2).
    backgroundRed - specifies the red component of the background color. Value must be between 0.0 and 1.0 inclusive.
    backgroundGreen - specifies the green component of the background color. Value must be between 0.0 and 1.0 inclusive.
    backgroundBlue - specifies the blue component of the background color. Value must be between 0.0 and 1.0 inclusive.
    borderRed - specifies the red component of the border color. Value must be between 0.0 and 1.0 inclusive.
    borderGreen - specifies the green component of the border color. Value must be between 0.0 and 1.0 inclusive.
    borderBlue - specifies the blue component of the border color. Value must be between 0.0 and 1.0 inclusive.
    Return Value: 0 - success
    1 - invalid shape
    2 - invalid backgroundRed
    3 - invalid backgroundGreen
    4 - invalid backgroundBlue
    5 - invalid borderRed
    6 - invalid borderGreen
    7 - invalid borderBlue
    Notes:
  • This is optional and if not specified no background is displayed behind the Bates "number".
  • If the BATES_BACKGROUND_OUTLINE_RECT shape is used the background color values are ignored.
  • Click here for more information and examples of real colors.

  •   I2PDF_BatesBackground_Int
    Parameters: shape - must be one of the following: BATES_BACKGROUND_FILLED_RECT (1) or BATES_BACKGROUND_OUTLINE_RECT (2).
    backgroundRed - specifies the red component of the background color. Value must be between 0 and 255 inclusive.
    backgroundGreen - specifies the green component of the background color. Value must be between 0 and 255 inclusive.
    backgroundBlue - specifies the blue component of the background color. Value must be between 0 and 255 inclusive.
    borderRed - specifies the red component of the border color. Value must be between 0 and 255 inclusive.
    borderGreen - specifies the green component of the border color. Value must be between 0 and 255 inclusive.
    borderBlue - specifies the blue component of the border color. Value must be between 0 and 255 inclusive.
    Return Value: 0 - success
    1 - invalid shape
    2 - invalid backgroundRed
    3 - invalid backgroundGreen
    4 - invalid backgroundBlue
    5 - invalid borderRed
    6 - invalid borderGreen
    7 - invalid borderBlue
    Notes:
  • This is optional and if not specified no background is displayed behind the Bates "number".
  • If the BATES_BACKGROUND_OUTLINE_RECT shape is used the background color values are ignored.
  • Click here for more information and examples of integer colors.

  •   I2PDF_BatesBackground_Web
    Parameters: shape - must be one of the following: BATES_BACKGROUND_FILLED_RECT (1) or BATES_BACKGROUND_OUTLINE_RECT (2).
    backgroundColor - specified as a hexadecimal string (from #000000 to #FFFFFF)
    borderColor - specified as a hexadecimal string (from #000000 to #FFFFFF)
    Return Value: 0 - success
    1 - invalid shape
    2 - invalid backgroundColor
    3 - invalid borderColor
    Notes:
  • This is optional and if not specified no background is displayed behind the Bates "number".
  • If the BATES_BACKGROUND_OUTLINE_RECT shape is used the background color values are ignored.
  • Click here for more information and examples of web colors.