PhilterPaper / Perl-PDF-Builder

Extended version of the popular PDF::API2 Perl-based PDF library for creating, reading, and modifying PDF documents
https://www.catskilltech.com/FreeSW/product/PDF%2DBuilder/title/PDF%3A%3ABuilder/freeSW_full
Other
6 stars 7 forks source link

Errors when using 3.021 with text() after having previously used a version in 2017. #145

Closed risner closed 3 years ago

risner commented 3 years ago

my $text = $page->text(); $text->font($bask, 6); $text->translate(32, 30); $text->text('Small Parts' , { color => 'black' });

That code results in this error now: Reference found where even-sized list expected at /Users/risner/perl5/lib/perl5/PDF/Builder/Content.pm line 3451, <> line 3.

Perl 5.32

There are other errors the code is reporting: Reference found where even-sized list expected at /Users/risner/perl5/lib/perl5/PDF/Builder/Content.pm line 3230. Odd number of elements in hash assignment at /Users/risner/perl5/lib/perl5/PDF/Builder/Content.pm line 3451.

Of note, the output is correct. The text is draw at the spot expected, as expected. Well as far as I can tell.

PhilterPaper commented 3 years ago

I don't think you're using correct Perl syntax here. I vaguely recall fixing a bug in how options were handled, which may have corrected the syntax here.

$text->text('Small Parts' , -indent => 18, -underline => 'auto' );

Colors cannot be set here as an option. You need to use something like the $text->fillcolor('black') method.

PhilterPaper commented 3 years ago

I have just released version 3.022. With no further comment from the OP, I'll assume that I can close this ticket now.