STAMPtk Manual
This STAMPtk manual documents all of its options and operations. Please consult our tutorials for some friendlier explanations. STAMPtk is a command-line program, so you should use your computer terminal or command prompt to try these examples.
Synopsis
Options
Stamptk creates PDF pages from your page range options that are input
on the command line, by one or more text files (via include=
), or both.
More than one page range can be described using the options, and these
separate page ranges can have overlapping or even identical page numbers.
< page range handle > is a sequence of upper-case letters (A-Z[A-Z]...) that identify the page range for which the given < option key > and < option value > apply. Options that use the same handle are combined to make one page range. Multiple page ranges can be described by using a different handle for each page range. Page ranges can have overlapping page numbers (see the range option).
< option key > is one of: text
| textUTF8
| pos
| origin
| size
| color
| font
| angle
| margin
| range
| stream
| embed
| media
< option value > is a value that suits the given option key, as follows:
text=< text string >
This is the text you want displayed on the page. It is restricted to the CP-1252 character set. You can set only one of these per page range, but you can add multiple text strings to a page by using multiple page ranges. It is encoded in CP-1252, optionally using escaped octal (\000) or hexadecimal (\xHH) for non-ASCII characters. Backslashes must be escaped using a backslash (\).
textUTF8=< text string >
This is the text you want displayed on the page. It is restricted to the CP-1252 character set. You can set only one of these per page range, but you can add multiple text strings to a page by using multiple page ranges. It is encoded in UTF-8.
pos=< X >,< Y >
This option sets the text’s position on the page. X or Y can
either be an absolute coordinate on the page or one of the relative arguments. Absolute coordinates are in points (72
points per inch), and the page origin is in the lower-left page corner.
The relative arguments are relative to the page. X relative
arguments are: center
, left
or right
, and Y relative arguments
are: center
, top
or bottom
. Default: center
,center
origin=< X >,< Y >
This sets the text’s origin to use when positioning the text on
the page with pos. X can be: center
, left
or right
, and Y can
be: center
, top
or bottom
. These describe the location of the
text’s origin using the text’s borders. Default: center
,center
size=< font size >
This sets the text’s size in points (72 points/inch). Default: 14
color=< red >,< green >,< blue > | #< RRGGBB >
This sets the text’s color. You have two formatting options: decimal or hex. When using decimal formatting, red, green and blue are decimal values between 0 and 255. When using hex formatting, RR, GG and BB are hexadecimal values between 00 and FF. Default: #000000 (black)
font=< standard font name >
This is the font used to display the text. It can be one of:
sans
- standard font HelveticasansBold
- standard font Helvetica-BoldsansItalic
- standard font Helvetica-ObliquesansBoldItalic
- standard font Helvetica-BoldOblique
serif
- standard font TimesserifBold
- standard font Times-BoldserifItalic
- standard font Times-ItalicserifBoldItalic
- standard font Times-BoldItalic
mono
- standard font CouriermonoBold
- standard font Courier-BoldmonoItalic
- standard font Courier-ObliquemonoBoldItalic
- standard font Courier-BoldOblique
If you add a page stream (described below) that uses one of
PDF’s standard fonts, then set this font option to match for the
relevant page(s). That will ensure that the required font
resources are packed into the PDF page. If no text or stream is
given for any page range, then no font resources are added to
the PDF. Default: sans
angle=N | NE | E | SE | S | SW | W | NW
This sets the text’s angle. It uses compass points to divide
the circle into 45-degree pieces. For example the N
angle gives
you right-reading text and the E
angle rotates the text 90
degrees clockwise so it reads from top to bottom. Text is
rotated on its origin, described above. Default: N
stream=stamptkStream...stamptkEndStream
This allows you to add your own PDF page description code to the
pages in the range. The given keywords delimit the PDF code
that will be added to the PDF page verbatim. There is a newline
after the first keyword and another newline before the last keyword.
This can be used in combination with the text
, textUTF8
and related options. When using only the stream
option, the
only other options to consider are the range
, embed
, media
and
font
options — the other options relate only to adding text to
the pages. You can apply multiple streams to a single page by
using multiple page ranges.
embed=< PDF string >
This takes an arbitrary string and invisibly embeds it into each
page’s PDF dictionary using the dictionary key stamptkData
.
This is useful if you have data you want to pass to a PDF parser
downstream. Parentheses and backslashes must be escaped with a
backslash. Only one can be set per page. If more than one
range sets this option, only the final setting will be used —
values are not appended the way page text and page streams are.
Maximum length: 64k bytes.
media=< standard page name >[Landscape] | < page width >,< page height >
This sets the page dimensions. For standard page name use one
of: letter
, tabloid
, ledger
, legal
,
statement
, executive
, folio
,
A0
, A1
, A2
, A3
, A4
, A5
, B4
or B5
, and you can append Landscape
to change its orientation. Or, you can give the page width and
page height in points (there are 72 points per inch). Default: letter
margin=< page margin >
is used in conjunction with relative pos values (top
, bottom
,
left
, right
) to tell stamptk how much space to keep between your
text origin and the edge of the page. It is an integer value
and its units are points (there are 72 points per inch).
Default: 24
range=< first page number >[-< final page number >[Even | Odd]]
where the page numbers give one or more pages to be used for
this page range. Page numbers are 1-based, so the first page is
numbered 1, not zero. On page ranges, you can append Even
or
Odd
to effect just those pages. Default: 1