Graphics Programs Reference
In-Depth Information
Integers and Real Numbers
An integer is written as one or more of the decimal digits 0..9 optionally preceded by
a plus or minus sign:
0 +1 -1 63
A real number is written as one or more decimal digits optionally preceded by a plus
or minus sign, and optionally having one decimal point, which may be leading, inside,
or following:
0.0 0. .0 -0.004 65.4
Frequently, the specification allows a given object to be either an integer or a real num-
ber. Other times it must be an integer. In addition, the range and accuracy of integers
and reals is defined by the PDF implementation, not the standard. In certain imple-
mentations, if an integer exceeds the range available, it is converted to a real number.
Exponential notation is not allowed. For example, you can't write
4.5e-6 .
Strings
Strings consist of a series of bytes, written between parentheses:
(Hello, World!)
The backslash \ character and the parenthesis characters ( ) must be escaped by pre-
ceding them with a backslash. For example, writing:
(Some \\ escaped \(characters)
represents the string “ Some \ escaped (characters ”. Balanced pairs of parentheses
within the string need not be escaped. For example, (Red (Rouge)) represents the string
Red (Rouge) ”.
A backslash can also be used to introduce other character codes for readability purposes
(see Table 3-2 ).
Table 3-2. Escape sequences in strings
Character sequence
Meaning
\n
Line feed
\r
Carriage return
\t
Horizontal tab
\b
Backspace
\f
Form feed
\ ddd
Character code in three octal digits
Search WWH ::




Custom Search