# Suite 330, Boston, MA 02111-1307 USA
use strict;
+#use warnings; FIXME - Bug 2505
use vars qw($VERSION @EXPORT);
use PDF::API2;
BEGIN {
# set the version for version checking
- $VERSION = 0.02;
+ $VERSION = 3.07.00.049;
require Exporter;
@EXPORT = qw(&labelsPage &getLabelPosition setPositionsForX setPositionsForY);
}
=head1 SYNOPSIS
- use C4::Barcodes::PrinterConfig;
+use C4::Barcodes::PrinterConfig;
=head1 DESCRIPTION
=head1 FUNCTIONS
-=over 2
+=head2 my @positionsForX;
-=cut
+Takes all the X positions of the pdf file.
+
+=head2 my @positionsForY;
+
+Takes all the Y positions of the pdf file.
-my @positionsForX; # Takes all the X positions of the pdf file.
-my @positionsForY; # Takes all the Y positions of the pdf file.
-my $firstLabel = 1; # Test if the label passed as a parameter is the first label to be printed into the pdf file.
+=head2 my $firstLabel = 1;
-=item setPositionsForX
+Test if the label passed as a parameter is the first label to be printed into the pdf file.
- C4::Barcodes::PrinterConfig::setPositionsForX($marginLeft, $labelWidth, $columns, $pageType);
+=head2 setPositionsForX
+
+ C4::Barcodes::PrinterConfig::setPositionsForX($marginLeft, $labelWidth, $columns, $pageType);
Calculate and stores all the X positions across the pdf page.
C<$pageType> Page type to print (eg: a4, legal, etc).
=cut
-#'
+
+# Globals used by the functions
+my @positionsForX;
+my @positionsForY;
+my $firstLabel = 1;
+
sub setPositionsForX {
my ($marginLeft, $labelWidth, $columns, $pageType) = @_;
my $defaultDpi = 72/25.4; # By default we know 25.4 mm -> 1 inch -> 72 dots per inch
@positionsForX = @positions;
}
-=item setPositionsForY
+=head2 setPositionsForY
- C4::Barcodes::PrinterConfig::setPositionsForY($marginBottom, $labelHeigth, $rows, $pageType);
+ C4::Barcodes::PrinterConfig::setPositionsForY($marginBottom, $labelHeigth, $rows, $pageType);
Calculate and stores all tha Y positions across the pdf page.
C<$pageType> Page type to print (eg: a4, legal, etc).
=cut
-#'
+
sub setPositionsForY {
my ($marginBottom, $labelHeigth, $rows, $pageType) = @_;
my $defaultDpi = 72/25.4; # By default we know 25.4 mm -> 1 inch -> 72 dots per inch
@positionsForY = @positions;
}
-=item getLabelPosition
+=head2 getLabelPosition
- (my $x, my $y, $pdfObject, $pageObject, $gfxObject, $textObject, $coreObject, $labelPosition) =
- C4::Barcodes::PrinterConfig::getLabelPosition($labelPosition,
- $pdfObject,
- $page,
- $gfx,
- $text,
- $fontObject,
- $pageType);
+ (my $x, my $y, $pdfObject, $pageObject, $gfxObject, $textObject, $coreObject, $labelPosition) =
+ C4::Barcodes::PrinterConfig::getLabelPosition($labelPosition, $pdfObject, $page, $gfx, $text, $fontObject, $pageType);
Return the (x,y) position of the label that you are going to print considering the environment.
C<$pageType> Page type to print (eg: a4, legal, etc).
=cut
-#'
+
sub getLabelPosition {
my ($labelNum, $pdf, $page, $gfxObject, $textObject, $fontObject, $pageType) = @_;
my $indexX = $labelNum % @positionsForX;
return ($positionsForX[$indexX], $positionsForY[$indexY], $pdf, $page, $gfxObject, $textObject, $fontObject, $labelNum);
}
-=item labelsPage
+=head2 labelsPage
- my @labelTable = C4::Barcodes::PrinterConfig::labelsPage($rows, $columns);
+ my @labelTable = C4::Barcodes::PrinterConfig::labelsPage($rows, $columns);
This function will help you to build the labels panel, where you can choose
wich label position do you want to start the printer process.
C<$columns> Indicates how many rows do you want in your page type.
=cut
-#'
+
sub labelsPage{
my ($rows, $columns) = @_;
my @pageType;
__END__
-=back
-
=head1 AUTHOR
Koha Physics Library UNLP <matias_veleda@hotmail.com>