Bug 41718 - draw_guide_grid() passes incorrect arguments to PDF methods, causing warnings.
Summary: draw_guide_grid() passes incorrect arguments to PDF methods, causing warnings.
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-27 02:55 UTC by Chris Nighswonger
Modified: 2026-01-30 06:08 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Nighswonger 2026-01-27 02:55:34 UTC
Patroncard.pm:219-221:
  $pdf->Font('Courier');
  $pdf->FontSize($font_size);
  my $strtop_len = $pdf->StrWidth($strtop) * 1.5;

There are actually two underlying bugs here:

Bug 1 (line 219): Uses hardcoded 'Courier' font name. This may not match a TTF config entry, and the fallback to prFont('Courier') may not work as expected.

Bug 2 (line 221): Calls $pdf->StrWidth($strtop) with only one argument, but StrWidth() in PDF.pm expects ($string, $font, $fontSize):

 # PDF.pm:411
  my ( $string, $font, $fontSize ) = @_;
  $font = C4::Creators::PDF->Font($font);  # $font is undef → warnings

 The correct call should be:
  my $strtop_len = $pdf->StrWidth($strtop, 'Courier', $font_size) * 1.5;