# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
use warnings;
use Text::Wrap qw(wrap);
#use Font::TTFMetrics;
-use C4::Creators::Lib 1.000000 qw(get_font_types);
-use C4::Creators::PDF 1.000000 qw(StrWidth);
-use C4::Patroncards::Lib 1.000000 qw(unpack_UTF8 text_alignment leading box get_borrower_attributes);
+use C4::Creators::Lib qw(get_font_types);
+use C4::Creators::PDF qw(StrWidth);
+use C4::Patroncards::Lib qw(unpack_UTF8 text_alignment leading box get_borrower_attributes);
BEGIN {
- use version; our $VERSION = qv('1.0.0_1');
+ use version; our $VERSION = qv('3.07.00.049');
}
sub new {
my ($self, $pdf, %params) = @_;
warn sprintf('No pdf object passed in.') and return -1 if !$pdf;
my @card_text = ();
- my $text = $self->{'layout'}->{'text'};
- return unless (ref($text) eq 'ARRAY'); # just in case there is not text
+ return unless (ref($self->{'layout'}->{'text'}) eq 'ARRAY'); # just in case there is not text
+ my $text = [@{$self->{'layout'}->{'text'}}]; # make a copy of the arrayref *not* simply a pointer
while (scalar @$text) {
my $line = shift @$text;
my $parse_line = $line;
while (1) {
# $line =~ m/^.*(\s\b.*\b\s*|\s&|\<\b.*\b\>)$/; # original regexp... can be removed after dev stage is over
$line =~ m/^.*(\s.*\s*|\s&|\<.*\>)$/;
- warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha.org', $line) and last WRAP_LINES if !$1;
+ warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha-community.org', $line) and last WRAP_LINES if !$1;
$trim = $1 . $trim;
$line =~ s/$1//;
$string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'});