61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
}
destructor {
catch {$pdf destroy}
}
method StartPrint {} {
# Page size
foreach {width height} [$pdf getDrawableArea] break
# Header metrics
$pdf setFont $options(-headsize) Courier
set headoffset [expr {$options(-headsize) + [$pdf getFontMetric bboxy]}]
set hoy $headoffset
# Figure out font size from number of chars per line
|
|
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
}
destructor {
catch {$pdf destroy}
}
method StartPrint {} {
# Page size
lassign [$pdf getDrawableArea] width height
# Header metrics
$pdf setFont $options(-headsize) Courier
set headoffset [expr {$options(-headsize) + [$pdf getFontMetric bboxy]}]
set hoy $headoffset
# Figure out font size from number of chars per line
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# Draw borders
$pdf setStrokeColor 0 0 0
$pdf setFillColor 0.0 0.0 0.0
$pdf setLineStyle 0.5
# Outer border
$pdf rectangle 0 $options(-headsize) \
$width [expr {$height - $options(-headsize)}]
# Center line
$pdf line [expr {$width / 2.0}] $options(-headsize) \
[expr {$width / 2.0}] $height
# Header
$pdf setFont $options(-headsize) Courier
$pdf text $options(-headleft) -x 0 -y $hoy
$pdf text "Page $page of $options(-headnpages)" \
-x [expr {$width / 2.0}] -y $hoy -align center
$pdf text $options(-headright) -x $width -y $hoy -align right
|
|
|
|
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# Draw borders
$pdf setStrokeColor 0 0 0
$pdf setFillColor 0.0 0.0 0.0
$pdf setLineStyle 0.5
# Outer border
$pdf rectangle 0 $options(-headsize) \
$width [- $height $options(-headsize)]
# Center line
$pdf line [/ $width 2.0] $options(-headsize) \
[/ $width 2.0] $height
# Header
$pdf setFont $options(-headsize) Courier
$pdf text $options(-headleft) -x 0 -y $hoy
$pdf text "Page $page of $options(-headnpages)" \
-x [expr {$width / 2.0}] -y $hoy -align center
$pdf text $options(-headright) -x $width -y $hoy -align right
|