my $ChartImageName = "$tmpPath/VeTCOChart.png"; setImage($ChartImageName, 110/mm, 165/mm, 95.25/mm, 79.375/mm); sub setImage{ my $photo_file=$pdf->image_png($_[0] ,-lossless => 1); my $photo = $page->gfx; ## add photo to pdf include cordinates and size - image($photo, x, y, width, hieght); $photo->image($photo_file, $_[1], $_[2], $_[3], $_[4]); }