#!/usr/bin/perl use strict; use PDF::API2; use PDF::APIx::Layout; my $pdf=PDF::API2->new; my @fonts = ( [$pdf->corefont('Times-Roman',-encode=>'latin1'), 'default', $pdf->corefont('Times-Bold',-encode=>'latin1'), 'bold', 'regular'] ); my $cell = PDF::APIx::Layout->MarkupText( q|

Hello bold new world

|, -fontreg=>\@fonts, -background=>'#aff', -align=>'c' ); my $page = $pdf->page; my $gfx = $page->gfx; $cell->render($pdf,$page,$gfx,100,500,100,100); $pdf->saveas('/tmp/hello_world.pdf');