PDF::Cairo::Util - utility functions
use PDF::Cairo::Util; $points = cm(5); $points = in(8.5); $points = mm(300); ($width, $height) = paper_size('usletter'); $hex = regular_polygon(6);
Converts the arguments from centimeters to points. Importable.
Converts the arguments from inches to points. Importable.
Converts the arguments from millimeters to points. Importable.
Return size in points of a paper type. The default is "US Letter" (8.5x11 inches). The wide/tall options can be used to ensure that the orientation of the page is as expected. Importable.
The supported paper sizes are listed in PDF::Cairo::Papers.
Calculate the vertices of a regular polygon with $sides sides with radius 1, along with the relative lengths of the inradius and edge.
Returns a hashref:
{ points => [ [$x0, $y0], ... ], edge => $edge_length, inradius => $inradius_length, radius => 1, }
Calling the polygon($cx, $cy, $radius, $sides) method is equivalent to:
$poly = regular_polygon($sides); @points = map(@$_, @{$poly->{points}}); $pdf->save; $pdf->translate($cx, $cy); $pdf->scale($radius); $pdf->poly(@points); $pdf->close; $pdf->restore;
Gosh, none I hope.
J Greely, <jgreely at cpan.org>
<jgreely at cpan.org>
To install PDF::Cairo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDF::Cairo
CPAN shell
perl -MCPAN -e shell install PDF::Cairo
For more information on module installation, please visit the detailed CPAN module installation guide.