In this section ...
... you learn what a stamp file is and how to build one.
- What is a Stamp File gives a general overview of what is in a stamp file and how it works.
- Create Stamp Files describes in detail every parameter that can be used within a stamp file and outlines how to put together stamp items.
- Creating Stamp Items for Text Stamps covers parameters specific to text stamps.
- Using Unicode explains how to use Unicode in your stamps.
- Stamping Barcodes shows how you can stamp barcodes onto documents.
- Creating Stamp Items for Image Stamps covers parameters specific to stamping images.
- Using Variables in Stamp Files explains how to use variables when creating text stamps.
- Letter Stamp Example explains the entire sample file letterstamp.txt.
We will be using the sample stamp file letterstamp.txt in the samples directory as an example throughout this chapter. The default location for StampPDF Batch on Windows is C:\Appligent\StampBatch\. On other platforms, it will be wherever you installed it.
What is a stamp file?
A stamp file is a text file that specifies how StampPDF Batch will apply stamps to your document. A stamp file has two main components
- an options block placed at the beginning of the stamp file, containing the version of the stamp file, and specifies general stamp properties. Each line in the options block describes properties for the entire PDF document being stamped.
- one or more stamp items that contain the parameters to describe a particular stamp. Each stamp has its own stamp item and a stamp file can have an unlimited number of stamp items.
Options block
The options block specifies properties for the entire file. It consists of the following sections:
- Label, specifies the version of the stamp file
- Positioning, specifies the default stamp margins for the entire PDF file.
- Acrobat options, specifies how Acrobat handles the document when opened.
Stamp Items
Each stamp file can specify many stamps. The parameters for an individual stamp are contained in a stamp item. StampPDF Batch supports these types of stamps:
- Text stamps, you specify the text to stamp onto the document.
- Unicode text stamps, you specify Asian characters to stamp onto the document
- Image stamps, you specify an image to stamp onto the document
- PDF stamps, PDF files are placed into your document
- Barcode stamps using a Code 128 barcode font
All types of stamps use pagination, positioning and general parameters. Other parameters are unique to each type of stamp. Stamp items begin with the keyword begin_message and end with the keyword end_message. In the following sections we will explain all the stamp item parameters, create stamp items for text stamps and create stamp items for image stamps.
Parameters
Each stamp item is described by a parameter/value pair. Enter parameters as follows:
Parameter (value)
For example:
Position (Top)
stamps the item on the top of the page.
Comments
You can insert comments where you need them to make the file more readable, or you can comment out sections for debugging purposes. Comments start with the hash or number symbol (#) and must be placed at the beginning of a line:
# This is a correct comment
Below is an incorrect comment
begin_message #beginning of the file list
Creating stamp files
Options block
| Type | Parameter | Required | Default | Content |
|---|---|---|---|---|
| Begin | begin_options | X | — | Beginning of option block |
| Label | Version | X | — | Version of stamp file: 2 |
| Positioning | TopMargin | — | 12 | Top margin of page in points |
| BottomMargin | — | 12 | Bottom margin of page in points | |
| LeftMargin | — | 8 | Left margin of page in points | |
| RightMargin | — | 8 | Right margin of page in points | |
| Acrobat Options | ViewMode | — | Unchanged | Zoom level the file should open in |
| OpenMode | — | Unchanged | Navigation mode the file should open in | |
| End | end_options | X | — | End of option block |
The options block begins with the begin_options and ends with the end_options keywords. Each stamp file has only one options block. For example, the options block in letterstamp.txt looks like this:
| Begin_Options | Begin Options block |
| Version (2) | Stamp file format version 2 |
| TopMargin (36) | Top margin 36 points (1/2 inch) |
| BottomMargin (36) | Bottom margin 36 points (1/2 inch) |
| LeftMargin (36) | Left margin 36 points (1/2 inch) |
| RightMargin (36) | Right margin 36 points (1/2 inch) |
| ViewMode (FitPage) | Open Document to see entire page |
| OpenMode (ShowNone) | Do not show navigation pane |
| End_Options | End Options block |
Provides labeling information for the stamp file.
Version (required)
The stamp file format version. The version parameter must be in the options block for the software to work. This version of StampPDF Batch uses version 2.
Page boundary margins parameters
Specifies the default page boundary margins of the file, the area where stamping can occur. See Options block page boundary margins vs. stamp margins below for more information on how these margins affect stamp placement.
TopMargin (optional)
The amount of space, in points, from the top of the document to the stamping area.
Default value: 12 points.
BottomMargin (optional)
The amount of space, in points, from the bottom of the document to the stamping area.
Default value: 12 points.
LeftMargin (optional)
The amount of space, in points, from the left of the document to the stamping area.
Default value: 8 points
RightMargin (optional)
The amount of space in points from the right side of the document to the stamping area.
Default value: 8 points.
Options block page boundary margins vs. stamp margins
When you specify the Positioning margins parameters for a stamp item, you will override the page boundary margins defined in the options block for that stamp item. See Page boundary margins parameters above for more information.
In the figure below, the margins are 36 points, one half inch. The centered, diagonal stamp is centered between all four margins. The top stamp begins at the left margin and the bottom stamp ends at the right margin. Margins in the options block differ from rectangle margins for a stamp item. See Page boundary margins parameters above for more information.

Converting inches to points
Margins are specified in points. One inch is equivalent to 72 points. The table below can help with conversions:
| Inches | Points |
|---|---|
| 0.11 | 8 |
| 0.167 | 12 |
| 0.5 | 36 |
| 0.75 | 54 |
| 1.0 | 72 |
| 1.5 | 108 |
| 2.0 | 144 |
An 8 1/2 x 11 inch page is 612 x 792 points.
Acrobat option parameters
Specifies the default Acrobat view and navigation modes for the file.
View Mode (optional)
The default document zoom level. Possible values are:
- ActualSize
- FitHeight, full page height fits into the document window
- FitPage, full page fits into the document window
- FitVisible, visible page area fits into the document window
- FitWidth, full page width fits into the document window
If the ViewMode is not specified, the document retains its original setting.
OpenMode (optional)
The default navigation mode. Possible values are:
- ShowBookMarks, file bookmarks are displayed in the navigation pane
- ShowThumbNails, page thumbnails are displayed in the navigation pane
- ShowNone, The navigation pane is not displayed
If OpenMode is not specified, the document retains its original setting.
Creating Stamp Items for Text Stamps
A stamp item begins with the begin_message and ends with the end_message keywords. Each stamp file can have many stamp items. Each text stamp item uses various parameters for the text item. Each parameter will be described in detail below.
The table below summarizes all the parameters available for stamp items.
| Type | Parameter | Text | Image | Default | Comments |
|---|---|---|---|---|---|
| Begin | begin_message | X | X | — |
Start of stamp item |
| Label | Name | X | X | — | Name for stamp |
| UndoLabel | X | X | — | Permits the later removal of a stamp | |
| Type | X | X | — | Required: Specifies type of stamp | |
| Pagination | StartPage | X | X | 1 | Start page for stamp |
| EndPage | X | X | -1 | End page for stamp | |
| PageIncrement | X | X | 1 | How many pages to skip between stamps | |
| PageRange | X | X | all | Which individual pages to stamp | |
| Positioning | Top,Right | X | — | From options block | Margins for stamp. Overrides margins of the page boundaries set in the options block for the stamp item |
| Bottom, Left | X | X | |||
| Position | X | X | Top | Position and orientation on page | |
| Justification | X | X | Center | Left, right or center | |
| Angle | X | — | 0 | Angle to rotate text stamp | |
| Underlay | X | X | No | Above (no) or beneath (yes) existing text/images | |
| PageBox | X | X | mediabox | Sets which set of page boundaries are used to position the stamp | |
| OffsetX | X | X | — | Horizontal placement offset | |
| OffsetY | X | X | — | Vertical placement offset | |
| Text Options | Size | X | — | 12 | Font size in points |
| Font | X | — | Helvetica-Bold | Name of font | |
| FontFile | X | — | — | Location of font file, if necessary | |
| TextMode | X | — | 0 | Mode: solid (0), outline (1) or invisible (2) | |
| Text | X | — | — | Text to stamp | |
| WordWrap | X | — | No | Insert line breaks to fit text within margins | |
| CharSpace, WordSpace | X | — | 0 | Change spacing between characters and words | |
| LineSpace | X | — | 1 | Change spacing between lines | |
| ColorSpace | X | — | DeviceGray | DeviceGray, DeviceRGB or Device CMYK | |
| Gray | X | — | 0 | DeviceGray: Gray level (0-100) | |
| Red,Green,Blue | X | — | 0,0,0, | DeviceRGB: RGB color values (0-255) | |
| Cyan,Magenta,Yellow,Black | X | — | 1,1,1,1 | DeviceCMYK: CMYK color values (0-1) | |
| BatesDigit | X | — | 0 | Number of digits in bates number | |
| Opacity | X | — | 1 | Transparency of text; 0-1 | |
| Image Options | Path | — | X | — | Location of image file |
| Scale | — | X | — | Specify size of image | |
| PageNumber | — | X | — | The page of a PDF to be stamped, only Type (PDF) | |
| End | end_message | X | X | — | End of stamp |
Stamp parameters detailed description
A stamp item begins with the begin_message and ends with the end_message keywords. Each stamp file can have many stamp items. Each parameter will be described in detail below
Name (optional)
Name identifies the stamp item. The Name parameter will help you keep track of many stamp items in one stamp file.
UndoLabel allows you to remove the stamp later. UndoLabel can be any character string, such as:
UndoLabel (undostamp)
Avoid using the characters \ / : * ? “< >| ^ and &. These characters cause problems when used on the command line. The UndoLabel is case sensitive.
A stamp created with an UndoLabel can be removed via the command line using the -u option. Using the command line and command line options are covered in Using StampPDF Batch. The command for undoing a stamp is:
stamppdf -u undostamp Sample1.pdf
After running this command any stamp that has the UndoLabel of “undostamp” in its stamp item will be removed from the document. Many stamps can have the same UndoLabel in their stamp item, they will all be removed at the same time. For example, if you would like to have all stamps removed with one command, use the same UndoLabel for all of them.
If a stamp item does not have an UndoLabel specified in the stamp file, you will not be able to remove it later. So if you are not sure, it’s always good to specify an UndoLabel and keep a record.
Note: Remember the name of your UndoLabel. There is nothing in the stamped document to indicate the name of a stamp item’s undo label. If you forget the undo label, and do not have the original stamp file to look it up, using the -u option is not possible. Also remember that undo labels are case sensitive. If you save the document from Acrobat using the “Save As” command, the undo labels will be lost.
Type (required)
The type of stamp you will be making. Text stamps can be plain text or Unicode. Image stamps can be JPEG, TIFF or PDF. Specify Barcode to stamp barcodes.
Specify the type of stamp using the following:
- Type (Text) for stamping plain text into your document
- Type (UTF8) for stamping UTF-8 Unicode characters into your document
- Type (UTF16) for stamping UTF-16 Unicode characters into your document
- Type (Barcode) for stamping code 128 barcodes
- Type (Image) for stamping JPEG or TIFF images onto your documents
- Type (PDF) for stamping PDF images onto your documents
For more information about Unicode stamps see Using Unicode. For more information on stamping images or PDF files see Creating Stamp Items for Image Stamps. For more information on stamping barcodes see Stamping Barcodes.
StartPage (optional)
StartPage specifies the first page to be stamped. Enter any page number or use -1 which is a shorthand notation for the last page. If you would like stamping to begin on the second page, enter 2 for StartPage. If you would like stamping to begin on the fifth page, enter 5 for StartPage. StartPage is optional; if StartPage is omitted, stamping will begin on page 1.
EndPage (optional)
EndPage specifies the last page to be stamped. For example, if you have a stamp that you need applied only to pages 2 through 10, use StartPage (2) and EndPage (10). The EndPage -1 notation indicates the last page of the document.
EndPage is optional; if EndPage is omitted, stamping will continue to the end of the file.
PageIncrement (optional)
PageIncrement specifies the increment to place stamps, i.e. on every other page, every fifth page, every tenth page, etc. For example, a PageIncrement of..
- 1 stamps every page
- 2 stamps every other page
- 5 stamps every fifth page
Page increments begin with the StartPage you specified. You can coordinate these parameters to stamp even pages, odd pages, or other increments of pages that you choose.
PageIncrement is optional; if PageIncrement is omitted, every page between StartPage and EndPage will be stamped.
The following table shows how the StartPage and PageIncrement parameters can be used together for stamping selected pages in a document:
| StartPage | PageIncrement | stamps pages |
|---|---|---|
| 1 | 1 | 1,2,3,4,5,etc. |
| 1 | 2 | 1,3,5,7,9,etc. |
| 2 | 2 | 2,4,6,8,10,etc. |
| 1 | 5 | 1,6,11,16,21,etc |
| 5 | 5 | 5,10,15,20,25,etc. |
You can apply different stamps on alternating pages, for example, to have the footer on even pages to be left-aligned, and on odd pages, right-aligned. You need two separate stamp items to achieve this: one with the left-aligned formatting and one with the right-aligned formatting. See the example below.
PageRange (optional)
PageRange lets you specify individual pages to stamp. PageRange overrides any range specified by StartPage, EndPage, and PageIncrement. To specify individual pages to stamp, list them separated by commas:
PageRange (1,3,6,8)
will stamp pages 1, 3, 6 and 8.
PageRange is optional; if all page options are omitted, every page will be stamped.
Top, Bottom, Left and Right (optional)
Top, Bottom, Left and Right parameters specify margins for the stamp item that override the page boundary margins set in the options block. These parameters define a rectangle in which to place a stamp. The Position and Justification parameters work relative to this new rectangle, rather than the margins set in the options block for that stamp item. See the figure below:

If you do not want to modify all of the margins, only set the ones you want changed. If you leave out one of the parameters, that margin remains as set in the options block.
Note: Setting rectangle margins using Top, Bottom, Left, and Right differs from setting margins in the options block. In the options block margins are set as the amount of space from the page edge to the margin. In the rectangles specified within a stamp item, all measurements are made from the lower left corner of the page.
Top, Bottom, Left and Right are optional; if any are omitted, the corresponding value from the options block will define the margin.
Position specifies where on the page the stamp item will appear. Position is optional. If Position is omitted, the stamp will be applied to the top. The figure below illustrates how various positions for stamps appear on pages. Allowed values are:
- Top, stamps text horizontally across the top of the page
- Bottom, stamps text horizontally across the bottom of the page
- VCenter, stamps text at the precise vertical center of the document, as defined by the margin settings. Horizontal positioning must still be defined by other parameters
- Diag-TopLeft, stamps text diagonally across the page beginning at the top left margin
- Diag-BottomLeft, stamps text diagonally across the page beginning at the bottom left margin
- Angle, used with the Angle parameter, described below, which will stamp text at any angle Position must be set to Angle for the Angle parameter to work

Justification specifies text alignment on document pages. Justification is optional. If Justification is omitted, the text will be centered. The figure below illustrates how stamps display on pages using various values. Possible values are:
- Left, aligns text with the left margin of the document.
- Right, aligns text with the right margin of the document
- Center, horizontally centers text between the left and right margins. Diagonal text stamps that use centering will also be centered vertically in the space between the top and bottom margins.

Use this parameter with Position, described above, to create accurate placement of your stamp.
Angle (optional)
Angle specifies an angle for stamp positioning, in degrees. Angle is optional. If Angle is omitted, text will be stamped horizontally. While a diagonal stamp will angle text on the page diagonal, the Angle parameter can position a text stamp at any angle. In order for the Angle parameter to be read, the Position parameter described above must be set to Angle.
The pivot point for an angle is defined by the Bottom and Left parameters. Justification for Angle is always Left. Any other value set for Justification will be ignored. Angle takes as its input any positive or negative number. Fractional angles are allowed (as in 37.5).
Underlay (optional)
Underlay specifies whether to stamp under, or on top of, existing text and graphics of the input PDF document. The figure below illustrates how stamps will appear on pages. Underlay is optional. If Underlay is omitted, text will be stamped over existing text and graphics. The options are:
- Yes, stamps text underneath the PDF document text and graphics.
- No, stamps text on top of the PDF document text and graphics.

Notes on using the Underlay option
Set Underlay to Yes to prevent covering the original PDF content. Other options for not obscuring original text are outline text, TextMode (1) or transparent text, Opacity (0.5).
- If the color of the text you stamp is the same color as the text in the document, your stamp will obscure the document text. To avoid this specify gray or a different color to make the stamp stand out from the overlaid text.
- Underlaid text stamped on PDF documents that are scanned as image files will not be visible. For these types of documents use an overlaid stamp, set Underlay to No.
- Some PDF files contain hidden text and images. Underlaid text will not be visible under hidden images. If you encounter this, overlay the stamped text, and use outline text, TextMode (1) or transparent text, Opacity (0.5).
- Under some circumstances, the combination of the printer driver and the application used to create the PDF document will create a white rectangle behind the PDF text. An underlying stamp will be hidden by the body of the PDF text and images. If you encounter this situation, create an overlay text stamp, and use outline text TextMode (1) or transparent text Opacity (0.5).
PageBox (optional)
This parameter sets which set of page boundaries are used to position the stamp. The options available for the PageBox parameter are mediabox, cropbox, artbox, trimbox and bleedbox. If the document you are stamping is cropped, set the PageBox parameter to cropbox.
Default value: mediabox
OffsetX (optional)
The OffsetX parameter allows you to specify a precise horizontal offset for a stamp item. The value of the offset is given in points, and can be positive or negative. A positive value of OffsetX will move the stamp to the right; a negative value will move the stamp to the left.
If you have a left-justified stamp with OffsetX set to 36 and LeftMargin set to 60, the image would be stamped 96 points from the left edge of the document: 60 points for the LeftMargin plus 36 points for the X offset.
OffsetX (36)
If you have a left-justified stamp with OffsetX set to -36 and LeftMargin set to 60, the image would be stamped 24 points from the left edge of the document: 60 points for the LeftMargin plus -36 points for the X offset.
OffsetX (-36)
OffsetY (optional)
The OffsetY parameter allows you to specify a precise vertical offset for a stamp item. The value of the offset is given in points and can be positive or negative. A positive value of OffsetY will move the stamp up; a negative value will move the stamp down. If you have a bottom-positioned stamp with OffsetY set to 20 and BottomMargin set to 72, the image would be stamped 92 points from the bottom edge of the document: 72 points for the BottomMargin plus 20 points for the Y offset.
OffsetY (20)
If you have a bottom-positioned stamp with OffsetY set to -20 and BottomMargin set to 72, the image would be stamped 52 points from the bottom edge of the document: 72 points for the BottomMargin plus -20 points for the Y offset.
OffsetY (-20)
Using a combination of OffsetX and OffsetY with Position and Justification parameters lets you place text and images very precisely in the document. See the figure below for examples of using these parameters.
As an example, a text stamp can be placed with a negative number of points to the left of the right margin of the stamp item when the Justification has been set to Right. See Position (optional) and Justification (optional) for more detailed information.
| #Options | Comment - Beginning of Stamp file |
| Begin_Options | Begin Options |
| Version (2) | Version Number |
| TopMargin (0) | Page - Top Margin |
| BottomMargin (0) | Page - Bottom Margin |
| LeftMargin (0) | Page - Left Margin |
| RightMargin (0) | Page - Right Margin |
| End_Options | End Options |
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Top Left) | Named Top Left |
| PageIncrement (1) | Stamp every page |
| StartPage (1) | Start on first page |
| EndPage (-1) | Stamp to the last page |
| Type (Image) | Image stamp |
| Path (./appligent_logo.jpg) | Path to image to be stamped |
| Position (top) | Position stamp at top |
| Justification (center) | Center justify |
| Underlay (no) | Place it over existing text and graphics |
| OffsetX (36) | X axis Offset |
| OffsetY (-36) | Y axis Offset |
| End_Message | End stamp item |
The figure below shows the upper left hand corner of a file stamped with the stamp item parameters from the figure above. The page margins are all set to 0; without the offsets, both the text and image would be placed on the top-left edge of the page.

Size (optional)
Size specifies the point size of the font that you are stamping. Fractional point sizes are allowed as in 11.5. Size is optional. If you omit this option, text will be stamped 12 points. To help decide on a point size for your text stamp, most text you read is 10 or 12 points. Newspaper text, for example, is usually 10 points. Business letters are commonly done in 12 points.
To create a watermark that fills a whole letter sized page diagonally, select a large point size: “Confidential” stamped in 128 points fills an 8 1/2 x11 inch page diagonally.
Font specifies the name of the font to use. Font is optional. If Font is omitted, stamping will be done in Helvetica Bold.
There are two types of fonts StampPDF Batch can use:
- One of the base 14 fonts
- An Adobe Postscript Type 1 font
Metrics for the base 14 fonts are included with StampPDF Batch. The names of the base 14 fonts are:
| • Courier | • Helvetica | • Times Roman | • Symbol | ||||
| • Courier-Bold | • Helvetica-Bold | • Times Bold | • Zapf Dingbats | ||||
| • Courier-Oblique | • Helvetica-Oblique | • Time Italic | |||||
| • Courier-BoldOblique | • Helvetica-BoldOblique | • Times Bold Italic |
If you use an Adobe Type 1 font, specify the PostScript name of the font. Refer to the documentation that came with the font.
Some names of common Adobe PostScript Type 1 fonts are New Century Schoolbook and News Gothic. You will need to check your own system to see what fonts are available to you.
FontFile (optional)
If you specify an Adobe Type 1 font, you must supply the path and name of the font file:
- Fonts use two files, a .pfb and a .pfm file. Both files need to be in the same directory, but you specify the .pfb file.
- If you use an Adobe Type 1 font, specify the PostScript name of the font. Refer to the documentation that came with the font. Some names of common Adobe PostScript Type 1 fonts are New Century Schoolbook and News Gothic. You will need to check your own system to see what fonts are available to you.
Notes on fonts
StampPDF Batch also supports the use of barcode fonts and OCR fonts (Optical Character Recognition) for use with scanning documents. Use these fonts in the same way as any other Postscript Type 1 font. Enter the font’s PostScript name in the Font parameter and enter the name and location of the font’s .pfb file in the FontFile parameter.
With any font that you use, make sure that you enter the name of the font properly, with the correct spelling, hyphenation and capitalization. All PostScript Type 1 fonts must have their PostScript name given for the Font parameter. For example, the PostScript name for New Century Schoolbook is NewCenturySchlbk-Roman, for News Gothic is NewsGothic, etc.
Note: You cannot use TrueType or OpenType fonts with StampPDF Batch. If you use a font other than a system or Standard font, it must be a PostScript Type 1 font.
PostScript Type 1 fonts may be purchased from Linotype’s website.
Using the same font more than once
If you use a PostScript Type 1 font more than once in your stamp file, the FontFile parameter is only required the first time. Subsequent stamp items only need the Font name.
If the FontFile is used more than once in the stamp file font information will be added again to the stamped document. This may result in unexpectedly large documents.
You can only use one font per stamp. However, if you would like to use two (or more) fonts and have them appear as the same stamp, make a separate stamp item for each font. For each item use the same position for the stamp, but insert spaces (not tabs) in the Text field of each stamp as placeholders for the characters in the other stamp so the two items do not overlap. For example, to create a stamp that has both Helvetica and Symbol characters, have one item stamping Helvetica and one stamping Symbol. The Font and Text fields are:
Item 1:
Font (Helvetica)
Text (The circumference of a circle is 2 r.)
Item 2:
Font (Symbol)
OffsetX (176)
Text (p)
The resulting stamp will look like this:
The circumference of a circle is 2πr.
TextMode (optional)
TextMode specifies stamp text as an outline, solid, or invisible. TextMode is optional; if TextMode is omitted, text will be solid. TextMode has three options:
- 0 stamps text as solid characters.
- 1 stamps text as outlined characters.
- 3 stamps invisible text.
The figure below illustrates the use of the TextMode parameter values.

Invisible text can be a useful aid for searching through a document. Acrobat’s Text Tool can highlight invisible text, showing its location in a PDF document. However, you won’t be able to see the text and it will not appear in the printed document.
Text (required)
Text specifies the content of the stamp. Type text exactly as you want it to appear. The figure below illustrates using the Text parameter.

With the Text parameter you can use variables to stamp dynamic information, such as the date and time of stamping or page numbers in a variety of formats. See Using variables in stamp files for more information.
WordWrap (optional)
WordWrap specifies whether long lines of text should wrap. WordWrap is optional. If WordWrap is omitted, any lines too long will be cut off. There are two possible values for WordWrap:
- Yes, if a line of text is too long to fit between the margins specified, it will continue on subsequent lines.
- No, if a line of text is too long to fit between the margins specified, it will be cut off at the edge of the margin.
Note: Word wrapping only works for ASCII text. If you are stamping CJK fonts using Unicode, use the MultiLine parameter and manually insert line breaks to make multiple line stamps. Refer to Multi-Line UTF8/UTF16 Stamps for information on inserting line breaks.
CharSpace and WordSpace (optional)
CharSpace adjusts character spacing and WordSpace adjusts word spacing. Enter a positive real number with up to three digits following the decimal point. A positive value (greater than 0) will increase the spacing; a negative value (less than 0) will decrease the spacing. Default value is 0, no change in spacing
LineSpace (optional)
LineSpace adjusts line spacing for multiple lines. Enter a positive real number with up to three digits following the decimal point. A value between 0 and 1 will decrease the line spacing; a value greater than 1 will increase the line spacing. LineSpace (2) will stamp multiple lines as doublespace.
Default value is 1, no change in linespacing
BatesDigit (optional)
BatesDigit is used to specify the number of bates digits for a stamp item containing a bates stamp variable (%J or %C). If BatesDigit is set to 3, page 2 will be stamped as 002, a BatesDigit of 5 will stamp 00002. See Using Bates notation for page numbering for information about bates numbering.
ColorSpace (optional)
ColorSpace specifies the text as grayscale or color. ColorSpace is optional; if ColorSpace is omitted, stamping will be done in DeviceGray. Specify the color of the stamp as follows:
- DeviceGray, a shade of gray. Use the Color parameter to specify the level of gray.
- DeviceRGB, a combination of Red, Green, and Blue values. Use the Red, Green, and Blue parameters to specify the color. This is common for on-line viewing.
- DeviceCMYK, a combination of Cyan, Magenta, Yellow, and Black values. Use the Cyan, Magenta, Yellow, and Black parameters to specify the color. This is common for print documents.
ColorSpace does not specify the color, only the type of color. You need to specify the color as described below.
Gray used with ColorSpace DeviceGray (optional)
Use Gray if your ColorSpace is DeviceGray. Gray is optional. If Gray is omitted, the stamped text will be black. Gray specifies a shade of gray, use a value between 0 and 100, where 0 is black and 100 is white. A Gray of 95 would be a very light gray, and a Gray of 15 would be a dark gray.
Gray (15)
The Color parameter used in previous versions of StampPDF Batch is supported for backward compatibility.
Red, Green and Blue used with ColorSpace DeviceRGB (optional)
Use Red, Green and Blue if your ColorSpace is DeviceRGB. Red, Green, and Blue are optional. If they are omitted, the text will be stamped black. The values for these colors can be in the range of 0-255, where 0 represents none of the color and 255 represents 100% of the color. You can combine varying amounts of the three color components to generate virtually any color. Here are some examples:
To create a purple stamp enter the following values for the color components:
Red (102)
Green (51)
Blue (204)
To create a green stamp enter:
Red (0)
Green (150)
Blue (0)
By not specifying the full 255 of green, a value of 150 will generate a lighter shade of green.
You must include values for each color: Red, Green, and Blue. Use a setting of 0 for colors you do not want.
Cyan, Magenta, Yellow, and Black used with ColorSpace DeviceCMYK (optional)
Use Cyan, Magenta, Yellow, and Black if your ColorSpace is DeviceCMYK. Cyan, Magenta, Yellow, and Black are optional. If they are omitted, the text will be stamped black. The values for these colors can be in the range of 0-1, where 0 represents none of the color and 1 represents 100% of the color. You can combine varying amounts of the four color components to generate virtually any color. Here are some basic examples:
To create the same color purple stamp enter the following values for the color components:
Cyan (0.63)
Magenta (0.76)
Yellow (0)
Black (0)
To create a Yellow stamp enter:
Cyan (0)
Magenta (0)
Yellow (0.5)
Black (0)
By not specifying the full 1 of Yellow, a value of 0.5 will generate a lighter shade of Yellow.
You must include values for each color: Cyan, Magenta, Yellow, and Black. Use a setting of 0 for colors you do not want.
Notes on Color
RGB vs. CMYK
If you’re not familiar with color spaces, you may be confused by the differences in the way colors are specified in RGB or CMYK.
RGB is a color space for televisions and computer monitors. Color is created by mixing Red, Green, and Blue light. The maximum values result in white light. Since computer monitors are digital, RGB levels are specified in a four-bit word, from 0 to 255.
CMYK is a color space for printing. Color is created by mixing Cyan, Magenta, Yellow, and Black inks. The maximum values result in black ink. Ink levels are specified in percentages, from 0 to 1.
How to select colors using RGB or CMYK components
On the internet, Palette Man and Visibone Webmaster’s Color Lab have tools to help you select a color. When you select a color that you like, the code for that color is given in RGB (Red, Green, Blue), CMYK (Cyan, Magenta, Yellow, and Black), and/or hexadecimal (used in HTML for web pages). Copy the RGB or CMYK values given and enter them into the corresponding parameters in the stamp file. You may also have software already installed on your computer that will help you design colors by accepting different values for color and displaying the results.
The values for RGB must be integers in the range 0-255. If you find colors defined as percentages, convert them to the 0-255 range. For example, 25% Red is 0.25 ✕ 255 = 64. The values for CMYK must be in the range 0-1. If you find the colors defined as percentages, convert to decimal equivalent. For example 52% Cyan is 0.52.
Opacity (optional)
Opacity specifies the transparency of the text. Values range from 0 to 1, where 0 is completely transparent (invisible) and 1 is completely opaque. Opacity allows you to place a stamp over existing text or graphics without completely obscuring the original. As an example, for a watermark that says “Draft” or “Confidential” and is a medium transparency use the following line in the stamp item:
Opacity (0.3)
A sample text stamp
The figure below shows the stamp item in letterstamp.txt to place a watermark looks like this:
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Watermark) | Named Watermark |
| Type (Text) | Text stamp |
| StartPage (1) | Start on page 1 |
| EndPage (-1) | Stamp to the last page |
| PageIncrement (1) | Stamp every page |
| Position (diag-topleft) | Position diagonally from the top left corner |
| Justification (center) | Center it both vertically and horizontally on the page |
| Underlay (yes) | Place it underneath existing text and graphics |
| Size (84) | Text size is 84 points |
| Font (Courier Bold) | Font is Courier Bold |
| TextMode (1) | Text will be an outline |
| Text (Confidential) | Text says "Confidential" |
| WordWrap (no) | Do not wrap to a new line |
| ColorSpace (DeviceGray) | Color is in grayscale |
| Gray (50) | Medium gray color |
| End_Message | End Stamp Item |
Using Unicode
StampPDF Batch can use unicode Asian characters in the text parameter to stamp Asian language characters. The stamp Type must be set to UTF8 or UTF16, and the font set to one of 7 predefined Asian fonts. If the stamp will be on more than one line, the Multiline parameter must also be set. The only place double-byte characters can be used is in the text parameter.
Prerequisites for Acrobat full version
In order to use Acrobat to view and print Asian text, you must have Asian language support files installed for both the Operating System (OS) and Acrobat. The table below shows whether Asian font support is automatically installed for your combination of OS and Acrobat, or whether you have to manually install it.
Unicode Font Support for Windows and Mac OS X and Acrobat
| OS | Font Support | |||
|---|---|---|---|---|
| Version | Automatic | Manual | ||
| OS | Windows | 2000 | — | X |
| Windows | XP | X | — | |
| Mac | OS X | X | — | |
| Acrobat | Windows | 5.0 | — | X |
| Windows | 6.0 and higher | — | X | |
| Mac OS X | 5.0 | — | X | |
| Mac OS X | 6.0 and higher | X | — | |
Operating System
Asian font support is automatically installed for all OS platforms except Windows 2000/NT. To install Asian font support, open Regional Options in the Control Panel, and add the fonts you want. You may need your original installation disk. Refer to the Windows On-line help for more information. You can also install keyboard support.
Acrobat
Asian font support is automatically installed only in Acrobat 6 under MacOS X. For all other versions, you will need to do a custom installation, and choose to install Asian font support. Refer to the Acrobat on-line help for more information.
Prerequisites for Acrobat Reader®
In order to use Acrobat Reader to view and print Asian text, you must install the Asian Font Pack from Adobe.
Windows/Unix
Download and install the Asian Font Pack
Reader components can be updated in a variety of ways. Some updates are available when you open a PDF that triggers the updating process automatically. For example, if you open a form that uses Asian language fonts, Reader asks whether you want to download the fonts. Other updates are available only from the Help menu, and you must install them manually. Some updates are available both automatically and manually.
MacOS X
You cannot download the Asian Font Pack for MacOS X. You must choose to install it when you install Acrobat Reader. If you did not, you must reinstall Reader.
Available fonts
The table below lists the 7 fonts that are available for double-byte character stamping:
| Font Name in StampPDF Batch | Font Name in Acrobat |
|---|---|
| HeiseiKakuGo-W5 | Heisei Kakugo |
| HeiseiMin-W3 | Heisei Mincho |
| HYGoThic-Medium | HYGoThic Medium |
| HYSMyeongJo-Medium | HYSMyeongJo Medium |
| MHei-Medium | MHei-Medium |
| MSung-Light | MSung Light |
| STSong-Light | STSong Light |
Use the font name in the left-hand column above in the Font parameter in your stamp file.
Character encoding
Stamp files can be encoded as Plain Text (ISO-8859 or ISO Latin 1) or as UTF-8. If you are going to use Asian characters, we recommend using UTF-8 stamp files and a text editor that supports UTF-8.
Type UTF8
Enter the Asian characters directly into the text parameter.
Only the Text parameter can have Asian fonts or any other higher level Unicode character. All other text in the file must use only the Latin character set (the first 128 characters, equivalent to “ASCII”). For example:
Type (UTF8)
Font (HeiseiMin-W3)
Text ![]()
Note:UTF-8 encoded characters are converted to UTF-16 before stamping into the document. UTF-16 characters are stamped directly into the document with no intervention by StampPDF Batch. If you want to make sure your characters are stamped directly with no conversion, use UTF-16.
Type UTF16
Enter double-byte characters in big-endian hexadecimal. Each character is represented by four hex digits. Enter the entire Text parameter as a string of hex codes with no breaks or prefixes.
For example, to enter the three characters 5185 5BC6 306E, enter:
Type (UTF16)
Font (HeiseiKakuGo-W5)
Text (51855BC6306E)
Refer to Resources for help finding codes.
Multi-Line UTF8/UTF16 Stamps
In order to get multi-line text stamps, you must set the MultiLine parameter to ‘yes’. StampPDF Batch will not check for line separator characters if the MultiLine parameter is set to ‘no’. Use the following codes for the line separator:
For UTF8, use \r as a line separator character. Place \r directly into the text where you want the new line to start. For example:
Type (UTF8)
Font (HeiseiMin-W3)
MultiLine (yes)
Text ![]()
For UTF16, place the Unicode line separator character 2028 in your text string where you want the new line to start. For example:
Type (UTF16)
Font (HeiseiKakuGo-W5)
MultiLine (yes)
Text (51855BC6306E202851855BC6306E)
Both Text parameters result in this stamp:

Resources
- http://www.unicode.org has the complete Unicode specification, providing a wealth of information on Unicode, character sets, and conversions.
- http://www.unipad.org/ provides a free trial of Unipad, a Windows-based Unicode text editor.
- http://www.cs.tut.fi provides an extensive tutorial on character sets, including Unicode.
Stamping Barcodes
StampPDF Batch can stamp barcodes using a Type1 barcode font, or directly using the Barcode type. For more information on stamping with Type1 fonts see Font (optional).
Specify stamping a barcode by setting the Type parameter to Barcode:
Type (Barcode)
StampPDF Batch only supports Code 128 barcodes, additional codes will be added in future releases.
Barcode Parameters
Code
Specifies the barcode type. Use instead of Font and FontFile. StampPDF Batch currently supports Code 128. Use:
Code (128)
to specify a Code 128 barcode.
StampPDF Batch uses Code 128 character set B. A simple Code 128 barcode (i.e., one character set) consists of a start character, the coded data, a calculated symbol check character, and an end character. StampPDF Batch automatically calculates the check character and places the start, check, and stop characters in the appropriate place. You only need to specify the data.
Size
Specifies the size of the barcode in points. 72 points equals one inch, so to meet UCC requirements of a minimum of 0.5 inch, specify 36 points
Default value: 12 points
BarScale
The horizontal scaling of the barcode.
Note: Use caution when using a BarScale value other than 1. Extreme scaling can affect the ability of a barcode scanner to read the barcode accurately. Test the stamped barcode with the scanner you will be using to make sure it can handle the scaling factor chosen.
Examples
The figure below shows a stamp item that stamps a plain barcode at the bottom of the page.
| # -- Barcode Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (BarcodeTest) | Named BarcodeTest |
| Type (Barcode) | Barcode stamp |
| StartPage (1) | Start on first page |
| EndPage (1) | Stamp only first page |
| Position (Bottom) | Position barcode on bottom of page |
| Justification (Center) | Center barcode |
| Underlay (no) | Place it over existing text and graphics |
| Size (36) | Size of barcode 36 points (1/2 inch) |
| Code (128) | Create Code 128 barcode |
| BarScale (1) | Keep normal horizontal scale |
| Text (This is a test) | Text of barcode "This is a test" |
| End_Message | End Stamp Item |

Creating Stamp Items for Image Stamps
You can also stamp images onto a document. Images for stamping can be in JPEG, TIFF, or PDF format. Both standard JPEG and Photoshop JPEG formats are supported.
For convenience, the parameters from the table below that pertain to image stamping are repeated here:
| Type | Parameter | Text | Image | Default | Comments | |
|---|---|---|---|---|---|---|
| Begin | begin_message | X | X | X | — | Start of stamp item |
| Label | Name | X |
X | X | — | Name of stamp |
| UndoLabel | X |
X | X | — | Permits the later removal of a stamp |
|
| Type |
X |
X | X | — | Required: Specifies type of stamp |
|
| Pagination | StartPage |
X |
X |
X |
1 | Start page for stamp |
| EndPage | X |
X |
X |
-1 |
End page for stamp |
|
| PageIncrement |
X |
X |
X |
1 |
How many pages to skip between stamps |
|
| PageRange | X |
X |
X |
all |
Which individual pages to stamp | |
| Positioning | Bottom,Left | X |
X | X | From Options Block |
Margins for stamp. Overrides margin values in options block |
| Position | X |
X |
X |
Top |
Position and orientation on page |
|
| Justification | X |
X |
X |
Center |
Left,right or center |
|
| Angle | X |
— |
— |
0 |
Angle to rotate text stamp |
|
| Underlay | X |
X | X | No | Above (no) or beneath (yes) existing text/images | |
| PageBox |
X |
X | X | mediabox | Sets which set of page boundaries are used to position the stamp | |
| OffsetX | X |
X | X | — | Horizontal placement offset | |
| OffsetY | X |
X | X | — | Vertical placement offset | |
| Image Options |
Path | — | X | X | — | Location of image file |
| Scale |
— | X |
X | — | Specify size of image | |
| PageNumber |
— | — |
X |
— | The page of a PDF to be stamped | |
| End |
end_message | X | X | X | — |
End of stamp item |
NOTE: In older versions of StampPDF Batch, only the Left and Bottom values are used for image stamping. StampPDF Batch will ignore values for Right and Top. With version 5.0, all four coordinates (top, bottom, left and right) are used to position and scale the image. With all four coordinates set, the scale parameter is ignored. If you wish to use the scale parameter, you should only specify Left and Bottom margins for the image stamp item.
The Label, Pagination, and Positioning parameters work as they do with text stamps. The parameters exclusive to Image stamps are described below.
Type (required)
Type specifies the kind of image that will be stamped. Images include JPEG and TIFF. PDF images are defined as a separate type. To specify the type of image use the following:
Image to stamp a JPEG or TIFF file
Type (Image)
PDF to stamp a PDF file
Type (PDF)
Path (required)
Path specifies the location of the image file to stamp. Enter the directory path, using the full path is best practice, and use the convention that is native to your operating system. Windows separates directories with backlashes:\, while Unix systems use forward slashes:/. For the image called Image.jpg in our samples directory Path will look like this on Windows:
Path (C:\Appligent\StampPDFBatch\Samples\Image.jpg)
Scale (optional)
The Scale parameter increases or decreases the size of the original image when it is stamped onto the PDF document. A scale of 0.5 will make the image half, 50%, of its original size, while a scale of 2, 200%, will double it.
Notes on positioning image files
Positioning works differently for images than it does for text.
For text, margin settings and positioning parameters act together to position a text stamp. The Top, Right, Bottom and Left parameters specify a rectangle, and the Position and Justification parameters place the text within that rectangle.
For images, the Bottom and Left parameters specify the location of the bottom left corner of the image.
The Position and Justification parameters are alternate means of specifying position. Use the Position parameter in place of Bottom for vertical positioning, and the Justification parameter in place of Left for horizontal positioning:
- Bottom overrides Position. If you specify a Bottom value, any Position value is ignored.
- Left overrides Justification. If you specify a Left value, any Justification value is ignored.
For example, you could specify that the left, bottom corner is a (0,0), but then you cannot center the image on the page as well.
In either case, use the angle and scale parameters to rotate and size the image.
A sample image stamp item
For example, the figure below shows the stamp item in letterstamp.txt to place a signature:
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Signature) | Named Signature |
| UndoLabel (RemoveSig) | UndoLabel in case we want to remove all the signatures later |
| Type (Image) | Image stamp |
| StartPage (-1) | Start on last page |
| EndPage (-1) | Stamp to the last page (stamp only last page) |
| Left (50) | Left, bottom corner of image is 50 points from left edge of page |
| Bottom (220) | Left, bottom corner of image is 220 points from bottom of page |
| Underlay (No) | Place it over existing text and graphics |
| Path (./samples/sig.jpg) | Use image file named sig.jpg in ./samples directory |
| Scale (1) | Place image at actual size |
| End_Message | End Stamp Item |
Stamping a PDF file
Set the Type parameter to PDF to stamp a PDF file onto your document. For example, if you have a company letterhead in PDF format, you can stamp this on all your computer generated invoices to create personalized, professional invoices.
Some notes about stamping PDF files:
- If the PDF document contains more than one page, the first page will be stamped onto your document by default. If you want to stamp an image of a different page use the PageNumber parameter listed below.
- PDF files are usually full page size. PDF stamps are convenient for stamping information that is already positioned on a page so you don’t have to worry about manually placing individual elements by specifying position in points.
- The white areas in a PDF stamp are not transparent. Make sure the stamp does not interfere with the content of your document and that you set Underlay to Yes. You can also crop the PDF page in Acrobat if the stamp does not fill the entire page to remove extra white areas.
- PageNumber (optional)
If you are placing an image of Type (PDF), and the PDF document has more than one page in the file, use the PageNumber option to specify the PDF page number that has the PDF image you want to stamp into your document. If you do not enter a PageNumber, the first page of the PDF will be used as the image stamp.
A sample PDF stamp item
For example, the figure below shows the stamp item in letterstamp.txt to place a PDF file looks like this:
| # -- Stamp Item -- | Comment |
| Begin_Messge | Begin Stamp Item |
| Name (Return Address) | Named Return Address |
| Type (PDF) | PDF Stamp |
| StartPage (1) | Start on first page |
| EndPage (1) | Stamp to the first page (stamp only first page) |
| Bottom (0) | Left, bottom corner of image is on the left edge of page |
| Left (0) | Left, bottom corner of image is on the bottom of page |
| Underlay (Yes) | Place it under existing text and graphics |
| Path (./samples/letterhead.pdf) | Use image file named letterhead.pdf in ./samples directory |
| End_Message | End Stamp Item |
Using variables in stamp files
When you are working with documents, there is a lot of information that varies from document to document such as dates, times, filenames, etc. Even within a document there are things that change from page to page, such as page numbers or headers and footers. StampPDF Batch provides variables that can stamp this information into your document.
Variables substitute for text in the Text parameter. Each variable is case sensitive and has a specific output. They are replaced at run-time with the information they represent. The variables can mix with text. For example, to stamp the date a file was created, create a stamp item with the following text parameter:
Text (This file was created on %a., %b. %d.)
The stamp appears as:
This file was created on Wed., Oct. 07.
Notice that we placed the appropriate punctuation as needed.
All variables must be preceded by the percent (%) character. If the % character is missing, the variable name will appear in the stamped text (“a” instead of “Wed”). If you want to use the % character in a stamp, it must be listed in the stamp file as %%.
The table below lists all the variables showing the variable name, what it does, and example output.
| Variable | Format | Example Output |
|---|---|---|
| %A | full weekday name | Friday |
| %a | abbreviated weekday name | Fri |
| %B | full month name | October |
| %b | abbreviated month name | Oct |
| %<page number>C | Consecutive bates numbering across files | 000001 |
| %c | local date and time | Friday, October 03, 2003 7:36:24 PM |
| %D | Ordinal suffix for dates | 1st, 2nd, 3rd, 4th etc. |
| %d | day of month | 15 |
| %G | total number of pages | 30 |
| %<page number>g | page number | 1 |
| %H | hours, 00-23 | 13 |
| %I | hour, 01-12 | 01 |
| %i<info field name> | PDF info dictionary value: Author, Title, Subject, Keywords | Sample.pdf (Title), Jane Smith (Author), Security (Keywords) |
| %<page number>J | Bates page numbering up to 999,999 | 000001 |
| %j | day of the year, 001-366 | 099 |
| %M | minutes, 00-59 | 25 |
| %m | month, 1-12 | 10 |
| %N | document filename | file.pdf |
| %n | New line. Use for multi-line stamps |
sample stamp, line 1 |
| %P | full document pathname | c:\MyDocuments\Stamp1.pdf |
| %p | local equivalent of AM or PM | PM |
| %r | lowercase roman numerals for page numbers | xii |
| %R | uppercase roman numerals for page numbers | XII |
| %S | seconds, 00-61 | 10 |
| %U | week of the year, 01-53 where Sunday is the first day of the week | 36 |
| %W | numeric week of the year, 00-53 where Monday is the first day of the week | 36 |
| %w | numeric weekday, 0-6 where Sunday is 0 | 5 |
| %X | local time representation | 05:35:10 |
| %x | local date representation | 10/03/03 |
| %Y | year with century | 2003 |
| %y | year without century, 00-99 | 03 |
| %% | % (use when stamp must include percent symbol) | % |
A sample stamp item using variables
For example, the figure below shows the stamp item in letterstamp.txt to place the current date:
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Current Date) | Named Current Date |
| Type (Text) | Text stamp |
| StartPage (1) | Start on first page |
| EndPage (1) | Stamp to the first page (stamp only first page) |
| Top (620) | Top margin 620 points from bottom of page |
| Left (44) | Left margin 44 points from left side of page |
| Position (top) | Position the top of the text along the top margin |
| Justification (left) | Left justify the text |
| Underlay (no) | Stamp on top of existing text and graphics |
| Size (12) | Font size 12 points |
| Font (Helvetica) | Font Helvetica |
| TextMode (0) | Solid text |
| Text (%A %B %d, %Y) | Insert Weekday Month day, year |
| WordWrap (No) | Do not wrap to a new line |
| ColorSpace (DeviceGray) | Color is in grayscale |
| Gray (0) | Black text |
| End_Message |
Stamping page numbers
Use the variable %<page number>g to stamp page numbers onto your document. <pagenumber> is optional, the default value is the logical number of the page. You can specify a different page to start with the parameter StartPage, the default for start page is the first page.
For example, if you would like page numbering stamps to begin on page 5, you need to tell StampPDF Batch two things:
- Where to begin stamping; use StartPage (<page >) in your stamp file
- What number to use when stamping that page; use Text (%<page number>g) in your stamp file
If you do not want to stamp page numbers to the end of the file, you can also specify an EndPage.
The following examples show how to apply page numbers for different circumstances.
Starting on the first page with page number 1
To start numbering on the first page, using page number 1, your stamp item would have the following line:
text (%g)
The default start page is 1, and the default page number would be 1, the logical number of the page.
Start on page 5 with page number 5
To start numbering on the page 5, using page number 5, your stamp item would have the following lines:
StartPage (5)
text (%g)
The start page is specified as page 5, and the default page number would be 5, the logical number of the page.
Start on page 5 with page number 1
To start numbering on the page 5, using page number 1, your stamp item would have the following lines:
StartPage (5)
text (%1g)
The start page is specified as page 5, and the page number is specified as 1. You can use this to start numbering the body of a document at 1 when the body starts after 4 pages of introductory material.
Using Bates notation for page numbering
Use the variable %<page number>J to stamp page numbers using Bates notation. With Bates notation each page number uses a fixed number of digits, filled with leading zeros. For example, with a six-digit Bates number (the default), page 2 will be written as 000002 and page 4145 will be written as 004145.
If you want to can change the default six-digit number format use the BatesDigit parameter. For example, to change page 2 to be written as 0002 and page 4145 to be written as 4145, your stamp item would have the following line:
BatesDigit (4)
You can also specify how many digits to use when you run StampPDF Batch by using the -j option on the command-line. Refer to -j <n> Number of digits for Bates numbering for more information.
Note: The value of the BatesDigit parameter will override the -j option.
If you would like to start numbering at a number other than 000001, place the number to start between % and J. For example, to start numbering at page 000501 use %501J in the Text parameter as shown in the figure below. StampPDF Batch will insert the leading zeros.

Adding a prefix to Bates numbers
You can add a prefix to Bates numbers by including the prefix before the variable, such as prefix text CaseABCD. The example below will stamp the StartPage with CaseABCD 000001, the next page with CaseABCD 000002, and so on.
CaseABCD %J
Prefixes can be combined with custom start pages. The example below will start page numbering at CaseABCD 000501.
CaseABCD %501J
Bates numbering across files
Use the variable %<page number>C to stamp Bates page numbers across multiple files. For example, if you stamp files Input001.pdf to Input005.pdf, and use the %C variable in your stamp file, the pages would be numbered as shown in the table below:
| Filename | Number Of Pages | Bates Number Stamped |
|---|---|---|
| Input001.pdf | 23 | 000001 to 000023 |
| Input002.pdf | 42 | 000024 to 000065 |
| Input003.pdf | 25 | 000066 to 000090 |
| Input004.pdf | 17 | 000091 to 000107 |
| Input005.pdf | 37 | 000108 to 000144 |
The files must be stamped at the same time. Refer to Stamp several documents with one stamp file for information on how to stamp multiple files at the same time.
Creating multi-line stamps
Use the %n variable to create a new line (or carriage return) in the stamped text. For example, if you would like to stamp a company address as a header, enter the text of the stamp in your Text parameter, including a %n wherever you wish a line break:
Text (Appligent, Inc.%n22 East Baltimore Avenue%nLansdowne,PA 19050 USA)
The files must be stamped at the same time. Refer to Stamp several documents with one stamp file on page 51 for information on how to stamp multiple files at the same time.
Appligent, Inc.
22 East Baltimore Avenue
Lansdowne, PA 19050 USA
There is no limit to the amount of text or number of lines you can use. You are limited only by the size of the page or the margins you have set.
Note: If you will be stamping footers at the bottom of the page, StampPDF Batch begins stamping at the Bottom margin. To prevent your stamp from running off the page increase the Bottom margin.

Stamping information from Document Info fields
The Document Info for a document is viewable from Adobe Acrobat or Acrobat Reader. Within Acrobat or Acrobat Reader select File>Document Info>General. A dialog window will appear:

StampPDF Batch can access the information here and stamp it into your PDF file. Take care to specify the variables exactly as they appear in the General Info dialog such as exact capitalization and spelling:
- %i(Author)
- %i(Subject)
- %i(Title)
For these variables to stamp correctly on a PDF document, the information must be present in the Document Information fields. If you enter a Text parameter to stamp Author and the Author field is blank in the General Information dialog window, StampPDF Batch won’t stamp the variable.
Letterstamp example
The example on the following pages shows the entire letterstamp.txt including the examples we’ve been using throughout this chapter.
| #Options | Comment |
| Begin_Options | Begin Options block |
| Version (2) |
Stamp file format version 2 |
| TopMargin (36) |
Top margin 36 points (1/2 inch) |
| BottomMargin (36) |
Bottom margin 36 points (1/2 inch) |
| LeftMargin (36) |
Left margin 36 points (1/2 inch) |
| RightMargin (36) |
Right margin 36 points (1/2 inch) |
| ViewMode (FitPage) |
Open document to see entire page |
| OpenMode (ShowNone) |
Do not show navigation pane |
| End_Options |
End Options block |
| # -- Stamp Item -- |
Comment |
| Begin_Message |
Begin Stamp Item |
| Name (Appligent Logo) | Named Appligent Logo |
| Type (Image) |
Image Stamp |
| StartPage (1) |
Start on first page |
| EndPage (-1) |
Stamp to the last page |
| PageIncrement (1) |
Stamp every page |
| Left (30) |
Left, bottom corner of image is 30 points from left edge of page |
| Bottom (700) |
Left, bottom corner of image is 700 points from bottom of page |
| Underlay (no) |
Place it over existing text and graphics |
| Path (./samples/image2.jpg) |
Use image file named image2.jpg in ./samples directory |
| Scale (.5) |
Image places at 1/2 actual size |
| End_Message |
End Stamp Item |
| # -- Stamp Item -- |
Comment |
| Begin_Message |
Begin Stamp Item |
| Name (Return Address) |
Named Return Address |
| Type (PDF) |
PDF stamp |
| StartPage (1) |
Start on first page |
| EndPage (1) |
Stamp to the first page (stamp only first page) |
| Bottom (0) |
Left, bottom corner of image is on the left edge of page |
| Left (0) |
Left, bottom corner of image is on the bottom edge of page |
| Underlay (Yes) |
Place it under existing text and graphics |
| Path (./samples/letterhead.pdf) |
Use image file named letterhead.pdf in ./samples/directory |
| End_Message |
End Stamp Item |
| # -- Stamp Item -- |
Comment |
| Begin_Message |
Begin Stamp Item |
| Name (Current Date) |
Named Current Date |
| Type (Text) |
Text stamp |
| StartPage (1) |
Start on first page |
| EndPage (1) |
Stamp to the first page (stamp only first page) |
| Top (620) |
Top margin 620 points from bottom of page |
| Left (44) |
Left margin 44 points from the left of page |
| Position (top) |
Position of top of the text along the top margin |
| Justification (left) |
Left justify the text |
| Underlay (no) |
Stamp on top of existing text and graphics |
| Size (12) |
Font size 12 points |
| Font (Helvetica) |
Font Helvetica |
| TextMode (0) | Solid text |
| Text (%A %B %d, %Y) | Insert Weekday Month day, Year |
| WordWrap (No) | Do not wrap to a new line |
| ColorSpace (DeviceGray) | Color is in grayscale |
| Color (0) | Black text |
| End_Message | End Stamp Item |
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Watermark) | Named Watermark |
| Type (Text) | Text stamp |
| StartPage (1) | Start on page 1 |
| EndPage (-1) | Stamp to the last page |
| PageIncrement (1) | Stamp every page |
| Position (diag-topleft) | Position diagonally from the top left corner |
| Justification (center) | Center it both diagonally and horizontally on the page |
| Underlay (Yes) | Place it underneath existing text and graphics |
| Size (84) | Text size is 84 points |
| Font (Courier Bold) | Font is Courier Bold |
| TextMode (1) | Text will be an outline |
| Text (Confidential) | Text says "Confidential" |
| WordWrap (No) | Do not wrap to a new line |
| ColorSpace (DeviceGray) | Color is in grayscale |
| Color (50) | Medium gray color |
| End_Message | End Stamp Item |
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Signature) | Named Signature |
| UndoLabel (RemoveSig) | UndoLabel in case we want to remove all signatures later |
| Type (Image) | Image stamp |
| StartPage (-1) | Start on last page |
| EndPage (-1) | Stamp to the last page (stamp only last page) |
| Left (50) | Left, bottom corner of image is 50 points from left edge of page |
| Bottom (220) | Left, bottom corner of image is 220 points from bottom of page |
| Underlay (No) | Place stamp over existing text and graphics |
| Path (./samples/sig.jpg) | Use image file named sig.jpg in ./samples directory |
| Scale (1) | Image places at actual size |
| End_Message | End Stamp Item |
| # -- Stamp Item -- | Comment |
| Begin_Message | Begin Stamp Item |
| Name (Disclaimer) | Named Disclaimer |
| Type (Text) | Text stamp |
| StartPage (1) | Start on first page |
| EndPage (-1) | Stamp to the last page |
| PageIncrement (1) | Stamps ever page |
| Position (bottom) | Positioned along bottom of page |
| Justification (center) | Center the text on page |
| Underlay (No) | Place it over existing text and graphics |
| Size (12) | Font size 12 points |
| Font (Times Bold) | Font Times Bold |
| TextMode (0) | Solid Text |
|
Text ( For use only with StampPDF Batch%n this Signature is for Sample purposes only and should not be used for any other situation) |
Insert disclaimer text. Note %n variable to insert a line break |
| WordWrap (No) | Do not wrap to a new line |
| ColorSpace (DeviceRGB) | Color is in RGB |
| Red (220) | Light Red |
| Green (67) | |
| Blue (71) | |
| End_Message | End Stamp Item |
| #Appligent, Inc. | Comment |
