#!/usr/bin/perl -w # Example 12-3. Images and clipping paths use strict; use PDF::API2; my $pdf=PDF::API2->new; my $page=$pdf->page(); $page->mediabox(300, 300); my $gfx = $page->gfx(); $gfx->circle(150, 150, 150); # Draw a circular path $gfx->clip(); # Make this path the clipping path $gfx->stroke(); # Draw the path my $img = $pdf->image('scotty.jpg'); # Read a JPEG image $gfx->image($img, 0, 0); # Add it to the page at the origin print $pdf->stringify(); $pdf->end; exit;