The example below shows the entire letterstamp.txt including the examples we’ve been using throughout this chapter.

Note This example is heavily commented to explain how the file works, and in normal use you do not need to include the comments.

#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 1                               Comment
Begin_Message                                   Begin Stamp Item
Name               (Appligent Logo)             Named Return Address
Type               (PDF)                        PDF stamp
StartPage          (1)                          Start on first page
EndPage            (-1)                         Stamp to the last page
Scale              (1)                          Add Scale parameter
Left               (40)                         Offset from left side
Underlay           (no)                         Place it over existing text and graphics
Path               (./samples/letterhead.pdf)   Use image file named letterhead.pdf in ./samples/directory
PageBox            (CropBox)                    Use CropBox to set page boundaries to position the stamp
End_Message                                     End Stamp Item

# -- Stamp Item 2                               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 last page
PageIncrement      (1)                          Stamp every 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)                         Place it over existing text and graphics
Size               (12)                         Font size 12 points
Font               (Helvetica)                  Font Helvetica
TextMode           (0)                          Solid text
Opacity            (1)                          Text will be opaque
Text               (%A %B %d, %Y)               Insert Weekday Month day, Year
WordWrap           (No)                         Do not wrap to a new line
Gray               (0)                          Black text
PageBox            (CropBox)                    Use CropBox to set page boundaries to position the stamp
UndoLabel          (undoStamp)                  Name of the undo label to remove stamps
End_Message                                     End Stamp Item

# -- Stamp Item 3                               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               (Helvetica Bold)             Font is Helvetica Bold
TextMode           (1)                          Text will be an outline
Text               (Confidential)               Text says "Confidential"
Opacity            (1)                          Text will be opaque
WordWrap           (No)                         Do not wrap to a new line
Gray               (50)                         Medium gray color
PageBox            (CropBox)                    Use CropBox to set page boundaries to position the stamp
UndoLabel          (undoStamp)                  Name of the undo label to remove stamps
End_Message                                     End Stamp Item

# -- Stamp Item 4                               Comment
Begin_Message                                   Begin Stamp Item
Name               (Signature)                  Named Signature
UndoLabel          (undoStamp)                  Name of the undo label to remove stamps
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             (225)                        Left, bottom corner of image is 225 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)                          Image places at actual size
PageBox            (CropBox)                    Use CropBox to set page boundaries to position the stamp
End_Message                                     End Stamp Item

# -- Stamp Item 5                               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 every 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               (Helvetica Bold)             Font Helvetica Bold
TextMode           (0)                          Solid Text
Text               (StampPDF Batch%nSignature)  Insert disclaimer text. Note %n variable to insert a line break
WordWrap           (No)                         Do not wrap to a new line
Opacity            (1)                          Text will be opaque
Red                (220)                        Light Red
Green              (67)
Blue               (71)
PageBox            (CropBox)                    Use CropBox to set page boundaries to position the stamp
UndoLabel          (undoStamp)                  Name of the undo label to remove stamps
End_Message                                     End Stamp Item
# Appligent, Inc.                               Comment