[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/barcodes label-print-pdf-zebra-2844.pl [dev_week]
From: |
Mason James |
Subject: |
[Koha-cvs] koha/barcodes label-print-pdf-zebra-2844.pl [dev_week] |
Date: |
Wed, 17 Oct 2007 08:01:20 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Mason James <sushi> 07/10/17 08:01:20
Modified files:
barcodes : label-print-pdf-zebra-2844.pl
Log message:
getting there
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-print-pdf-zebra-2844.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.2&r2=1.1.2.3
Patches:
Index: label-print-pdf-zebra-2844.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/Attic/label-print-pdf-zebra-2844.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- label-print-pdf-zebra-2844.pl 17 Oct 2007 02:04:18 -0000 1.1.2.2
+++ label-print-pdf-zebra-2844.pl 17 Oct 2007 08:01:20 -0000 1.1.2.3
@@ -12,7 +12,8 @@
use PDF::Reuse::Barcode;
use POSIX;
-use Smart::Comments '###';
+#use Smart::Comments '###';
+use Smart::Comments '####';
my $htdocs_path = C4::Context->config('intrahtdocs');
my $cgi = new CGI;
@@ -36,6 +37,8 @@
my $start_label = $conf_data->{'startlabel'};
my $fontsize = $template->{'fontsize'};
+my $fontsize = 6;
+
my $units = $template->{'units'};
my $unitvalue = GetUnitsValue($units);
@@ -46,25 +49,24 @@
my $batch_count = get_batch_count($batch_id);
### $batch_count
-my $page_height = 792;
-my $page_width = 612;
+my $page_height = 108;
+my $page_width = 274;
+
-my $block_height = 144;
-my $block_width = 272;
-my $label_height = 72;
-my $label_width = 196;
+my $label_height = 100;
+my $label_width = 188;
-my $spine_width = 65;
-my $spine_height = 108;
+my $spine_height = 100;
+my $spine_width = 68;
-my $top_margin = 41;
-my $left_margin = 27;
-my $colspace = 12;
-my $rowspace = 0;
+my $top_margin = 3;
+my $left_margin = 5;
+my $colspace = 9;
+my $rowspace = 3;
-my $block_cols = 1;
-my $block_rows = $batch_count;
+my $label_cols = 1;
+my $label_rows = 1;
#warn $label_cols, $label_rows;
@@ -93,122 +95,107 @@
# big row loop
-#warn " $lowerLeftX, $lowerLeftY, $upperRightX, $upperRightY";
+warn " $lowerLeftX, $lowerLeftY, $upperRightX, $upperRightY";
#warn "$label_rows, $label_cols\n";
-#warn "$label_height, $label_width\n";
-#warn "$page_height, $page_width\n";
+warn "$label_height, $label_width\n";
+warn "$page_height, $page_width\n";
my ( $rowcount, $colcount, $x_pos, $y_pos, $rowtemp, $coltemp );
-$start_label = 1; ## debug...................................
-
-if ( $start_label eq 1 ) {
$rowcount = 1;
$colcount = 1;
$x_pos = $left_margin;
- $y_pos = ( $page_height - $top_margin - $block_height );
-}
-
-else {
+ $y_pos = ( $page_height - $top_margin - $label_height );
- #eval {
- $rowcount = ceil( $start_label / $block_cols );
- #} ;
- #$rowcount = 1 if $@;
-
- $colcount = ( $start_label - ( ( $rowcount - 1 ) * $block_cols ) );
-
- $x_pos = $left_margin + ( $label_width * ( $colcount - 1 ) ) +
- ( $colspace * ( $colcount - 1 ) );
-
- $y_pos = $page_height - $top_margin - ( $block_height * $rowcount ) -
- ( $rowspace * ( $rowcount - 1 ) );
-
-}
#
# main foreach loop
#
-# $barcodetype = "CODE39MOD10";
+$barcodetype = "CODE39";
my $gutter = 2;
+my $barcode_height =40;
+my $barcode_width = 200;
+
foreach $item (@resultsloop) {
- my $barcode = $item->{'barcode'};
- $item->{'callnumber'} = 'BT 380.2 W54';
- my @callnumber = split( ' ', $item->{'callnumber'} );
+#### $item
+
+
+
+ # my @spine_fields = qw ( moo foo doo yoo );
my @spine_fields = (
- $item->{'ccode'}, $callnumber[0], $callnumber[1], $callnumber[2],
- $item->{'copyrightdate'}
- );
+ $item->{'itemcallnumber'},
+ ,'*', '*','*',
+ ,'*', '*','*',
+ ,'*', '*','*',
+ ,'*', '*','*',
+ $item->{'replacementpricedate'},
+ $item->{'homebranch'});
+
+ my $callnum_author = $item->{'itemcallnumber'}.' '. $item->{'author'};
my @circ_fields = (
- $item->{'ccode'}, $callnumber[0], $callnumber[1], $callnumber[2],
- $item->{'copyrightdate'}
- );
+ $callnum_author,
+ $item->{'title'},
+ "$item->{'barcode'} $item->{'homebranch'}",
+ '530a');
- my @circ2_fields = ( $item->{'author'}, $item->{'title'} );
- my @circ_barcode = ( $item->{'barcode'} );
- my $fontsize = 10;
- # warn "$x_pos, $y_pos, $label_width, $label_height";
- my $barcode = $item->{'barcode'};
- # drawbox( $x_pos, $y_pos, $block_width, $block_height, ) if $guidebox;
+
+ warn "$x_pos, $y_pos, $label_width, $label_height";
#-- spine
- drawbox( $x_pos, $y_pos + ( $block_height - $spine_height ),
+ drawbox( $x_pos, $y_pos ,
$spine_width, $spine_height, )
if $guidebox;
draw_text_block_manual( # spine
- $x_pos, $y_pos + ( $block_height - $spine_height ), $spine_width,
- $spine_height, $fontsize, '', $gutter, 'l',
+ $x_pos, $y_pos ,
+ $spine_width,
+ $spine_height,
+ $fontsize, '', $gutter, 'l',
@spine_fields
);
#-- spine
-$cgi->param('batch_id');
+ $cgi->param('batch_id');
- #-- top barc
+ #-- top barc ------------------------------------------
drawbox(
( $x_pos + $spine_width + $colspace ),
- $y_pos + $label_height,
+ $y_pos ,
$label_width, $label_height,
) if $guidebox;
- draw_text_block_manual(
- ( $x_pos + $spine_width + $colspace ),
- ( $y_pos + $label_height ),
- $label_width, $label_height, $fontsize, '', $gutter, 'r', @circ_barcode
- );
draw_text_block_manual(
( $x_pos + $spine_width + $colspace ),
- ( $y_pos + $label_height ),
+ $y_pos ,
$label_width, $label_height, $fontsize, '', $gutter,, '', @circ_fields
);
- draw_text_block_manual(
- ( $x_pos + $spine_width + $colspace + $spine_width ),
- ( $y_pos + $label_height ),
- ( $label_width - $spine_width ),
- $label_height,
- $fontsize,
- 2,
- $gutter,
- 'l',
- @circ2_fields
- );
+
+ DrawBarcode (
+ ($x_pos + $spine_width + $colspace ),
+ ($y_pos + 10 ),
+ $barcode_height, $barcode_width, $item->{'barcode'},
+ $barcodetype );
+
+
+
+
+
#-- top barc
- #calc_next_block_position();
+
CalcNextLabelPos();
# last;
@@ -220,30 +207,36 @@
#
#
#
+
sub CalcNextLabelPos {
- if ( $colcount lt $block_cols ) {
+ if ( $colcount lt $label_cols ) {
# warn "new col";
- $x_pos = ( $x_pos + $block_width + $colspace );
+ $x_pos = ( $x_pos + $label_width + $colspace );
$colcount++;
}
else {
$x_pos = $left_margin;
- if ( $rowcount eq $block_rows ) {
+ if ( $rowcount eq $label_rows ) {
# warn "new page";
prPage();
- $y_pos = ( $page_height - $top_margin - $block_height );
+ $y_pos = ( $page_height - $top_margin - $label_height );
$rowcount = 1;
}
else {
# warn "new row";
- $y_pos = ( $y_pos - $rowspace - $block_height );
+ $y_pos = ( $y_pos - $rowspace - $label_height );
$rowcount++;
}
$colcount = 1;
}
}
+
+
+
+
+