According to PDF :: API2 :: Content, it looks like you are passing a hashref method for a text method (in PDF :: API :: Content :: Text object format).
Therefore, it should βworkβ as follows (NB. I do not have a PDF :: API2 file installed here, so the code below is not verified):
use PDF::API2; use PDF::API2::Util; my $pdf = PDF::API2->new; my $font = $pdf->corefont('Helvetica',-encode=>'latin1'); my $page = $pdf->page; $page->mediabox( 80, 500 ); my $txt = $page->text; $txt->font( $font, 20 ); $txt->translate( 50, 800 ); $txt->text('Hello there!', { color => '#e6e6e6' } );
Hope this helps?
source share