in reply to Add Border to a PDF file
Do you mean adding a border around each page?
The following uses PDF::API2 directly to draw a 1 pt border 10pt (~3.5mm) in from the edge of the page
#!/usr/bin/perl use warnings; use strict; use PDF::API2; my $pdf = PDF::API2->open('/tmp/test.pdf'); foreach my $pagenum (1 .. $pdf->pages) { my $page = $pdf->openpage($pagenum); # # Get the page size # my @mbox = $page->get_mediabox; my $gfx = $page->gfx; # # Draw a box 10pt in from the edges of the page # $gfx->linewidth(1); $gfx->strokecolor('#000000'); $gfx->rect($mbox[0]+10, $mbox[1]+10, $mbox[2]-20, $mbox[3]-20); $gfx->stroke; } $pdf->savas('/tmp/test1.pdf');
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Add Border to a PDF file
by artist (Parson) on Jul 24, 2007 at 05:50 UTC | |
by snoopy (Curate) on Jul 24, 2007 at 07:41 UTC | |
by Anonymous Monk on Jul 24, 2007 at 15:24 UTC |
In Section
Seekers of Perl Wisdom