#!/usr/bin/perl use strict; use warnings; use PDF::API2; my $text = "Some text on top of the image"; my $pdf = PDF::API2->new(); my $page = $pdf->page; my $gfx = $page->gfx; my $img = $pdf->image_jpeg("background.jpg"); $gfx->image( $img, 30, 100, # position (by default in points (=1/72 inch)) 0.5 # scaling (i.e. size) # (you'll probably want to play with those...) ); my $font = $pdf->corefont('Helvetica-Bold', -encoding => 'latin1'); $gfx->textlabel( 100, 100, # position (in points) $font, 30, # font and size $text, # guess what... # options -color => '#ff0080', # in pink ;) -rotate => 30, # angle ); $pdf->saveas("Test2.pdf");