Subject: | Improvement allowing custom page sizes |
This improvement allows the user to specify the page width (in points)
by passing an arrayref instead of a scalar string describing the page
size. The array is width, then height.
An example call is like this:
my $pdf = new PDF::Report2(
PageSize => [5.5*72, 8.5*72],
PageOrientation => "portrait",
);
Landscape/portrait settings are still followed; the example given above
is portrait, but will be flipped if the landscape setting is used.
107,109c107,120
< # Set the width and height of the page
< my ($x1, $y1, $pageWidth, $pageHeight) =
< PDF::API2::Util::page_size($DEFAULTS{PageSize});
---
Show quoted text
>
> my $pageWidth;
> my $pageHeight;
> my $x1;
> my $y1;
> if ( ref $DEFAULTS{PageSize} eq "ARRAY" ) {
> ($pageWidth, $pageHeight) = @{$DEFAULTS{PageSize}};
> }
> else {
> # Set the width and height of the page
> ($x1, $y1, $pageWidth, $pageHeight) =
> PDF::API2::Util::page_size($DEFAULTS{PageSize});
> }
>