use strict; use PDF::API2; use PDF::API2::Util; my $pdf = PDF::API2->new('pagesize' => 'a4','compression'=>1); my $page = $pdf->page; my $font=$pdf->corefont('Helvetica',1); $font->encode('latin1'); my $txt=$page->text; $txt->compress; $txt->font($font,16); $txt->translate($x,$y); #Define coords here $txt->fillcolor(namecolor("darkorange")); #Define some other color here $txt->text("The quick brown fox jumps over the lazy dog"); $pdf->saveas('empty.pdf'); $pdf->end();