I've never used PDF::API3::Compat::API2 myself, but as it says
Compat::API2, I guess the idea is to be able to do it like you would
in PDF::API2 — which would be:
use PDF::API2;
my $pdf = PDF::API2->open('uncropped.pdf');
$pdf->cropbox(100,100,500,500);
$pdf->openpage(1);
$pdf->saveas('cropped.pdf');
The crucial thing is to open the respective page(s),
as the cropbox will only have an effect on newly rendered
objects, i.e. objects opened for modification.
Here are the PDFs — for reference, or to play with:
uncropped.pdf,
cropped.pdf
|