|
Lines 69-74
sub draw_barcode {
Link Here
|
| 69 |
sub draw_guide_box { |
69 |
sub draw_guide_box { |
| 70 |
my ($self, $pdf) = @_; |
70 |
my ($self, $pdf) = @_; |
| 71 |
warn sprintf('No pdf object passed in.') and return -1 if !$pdf; |
71 |
warn sprintf('No pdf object passed in.') and return -1 if !$pdf; |
|
|
72 |
|
| 72 |
my $obj_stream = "q\n"; # save the graphic state |
73 |
my $obj_stream = "q\n"; # save the graphic state |
| 73 |
$obj_stream .= "0.5 w\n"; # border line width |
74 |
$obj_stream .= "0.5 w\n"; # border line width |
| 74 |
$obj_stream .= "1.0 0.0 0.0 RG\n"; # border color red |
75 |
$obj_stream .= "1.0 0.0 0.0 RG\n"; # border color red |
|
Lines 79-84
sub draw_guide_box {
Link Here
|
| 79 |
$pdf->Add($obj_stream); |
80 |
$pdf->Add($obj_stream); |
| 80 |
} |
81 |
} |
| 81 |
|
82 |
|
|
|
83 |
sub draw_guide_grid { |
| 84 |
my ($self, $pdf) = @_; |
| 85 |
warn sprintf('No pdf object passed in.') and return -1 if !$pdf; |
| 86 |
|
| 87 |
my $obj_stream = "q\n"; # save the graphic state |
| 88 |
|
| 89 |
my $x = $self->{'llx'}; |
| 90 |
my $y = $self->{'lly'}; |
| 91 |
|
| 92 |
my $cnt = 0; |
| 93 |
for ( $x = $self->{'llx'} ; $x <= $self->{'llx'} + $self->{'width'}; $x+=10) { |
| 94 |
my $xx = $x; |
| 95 |
my $yy = $y + $self->{'height'}; |
| 96 |
if ( $cnt % 5 ) { |
| 97 |
$obj_stream .= "0.0 1.0 1.0 RG\n"; |
| 98 |
$obj_stream .= "0 w\n"; |
| 99 |
} else { |
| 100 |
$obj_stream .= "0.0 0.0 1.0 RG\n"; |
| 101 |
$obj_stream .= "0 w\n"; |
| 102 |
} |
| 103 |
$cnt ++; |
| 104 |
|
| 105 |
$obj_stream .= "$x $y m\n"; |
| 106 |
$obj_stream .= "$xx $yy l\n"; |
| 107 |
|
| 108 |
$obj_stream .= "s\n"; |
| 109 |
} |
| 110 |
|
| 111 |
$x = $self->{'llx'}; |
| 112 |
$y = $self->{'lly'}; |
| 113 |
$cnt = 0; |
| 114 |
for ( $y = $self->{'lly'}; $y <= $self->{'lly'} + $self->{'height'}; $y+=10) { |
| 115 |
|
| 116 |
my $xx = $x + $self->{'width'}; |
| 117 |
my $yy = $y; |
| 118 |
|
| 119 |
if ( $cnt % 5 ) { |
| 120 |
$obj_stream .= "0.0 1.0 1.0 RG\n"; |
| 121 |
$obj_stream .= "0 w\n"; |
| 122 |
} else { |
| 123 |
$obj_stream .= "0.0 0.0 1.0 RG\n"; |
| 124 |
$obj_stream .= "0 w\n"; |
| 125 |
} |
| 126 |
$cnt ++; |
| 127 |
|
| 128 |
$obj_stream .= "$x $y m\n"; |
| 129 |
$obj_stream .= "$xx $yy l\n"; |
| 130 |
$obj_stream .= "s\n"; |
| 131 |
} |
| 132 |
|
| 133 |
$obj_stream .= "Q\n"; # restore the graphic state |
| 134 |
|
| 135 |
$pdf->Add($obj_stream); |
| 136 |
} |
| 137 |
|
| 138 |
|
| 82 |
sub draw_text { |
139 |
sub draw_text { |
| 83 |
my ($self, $pdf, %params) = @_; |
140 |
my ($self, $pdf, %params) = @_; |
| 84 |
warn sprintf('No pdf object passed in.') and return -1 if !$pdf; |
141 |
warn sprintf('No pdf object passed in.') and return -1 if !$pdf; |