1 2 3 4 5 6 7 8 9 10 11 12 13 14
use strict; use warnings; use PDF::API2; my $pdf = new PDF::API2; my $page = $pdf->page(); $page->mediabox( 1920, 1080 ); my $wallpaper = $page->gfx; my $wp_file = $pdf->image_jpeg( 'sample.jpg' ); $wallpaper->image( $wp_file, 0, 0, 1920, 1080 ); $pdf->saveas( 'helloworld.pdf' );
QuoteFor complex stuff some understanding of the underlying Postscript/PDF format is necessary. In this case it might be better go with the more complete the PDF::API2 manpage modules to gain more features at the expense of a steeper learning curve.