PDF::GraphicsUtils - Provides classes and routines for manipulating PDF page objects.
use PDF::Lite;
use PDF::GraphicsUtils;
my PDF:Lite $pdf .= new;
my $page = $pdf.add-page;
my $g = Graphics.new: :$page;
# draw a circle on the page with values in PS points
my ($x, $y, $radius) = 200, 200, 30;
$g.circle: :$x, :$y, :$radius;
# use other units of length for another circle
$g.circle: :x<2in>, :y<3in>, :radius<0.5in>;
$pdf.save-as: "mypdf.pdf";
# View the pdf file and see two circlesPDF::GraphicsUtils is a large collection of graphics objects with the ability to use various units to place them on the page as well as to describe their shape. See a complete list of graphics methods at GRAPHICS-METHODS.
Units available:
If a number is entered without a suffix, the number is treated as a value in PS (PostScript) points (72 per inch). A unit may be specified with a one- or two-letter suffix as shown in the following table.
| Unit | Suffix |
|---|---|
| PostScript | ps |
| millimeters | mm |
| centimeters | cm |
| inches | in |
| feet | ft |
| meters | m |
| yards | y |
If a number is entered without a suffix, the number is treated as a value in degrees. A unit may be specified with a three-letter suffix as shown in the following table.
| Unit | Suffix |
|---|---|
| degrees | deg |
| radians | rad |
Tom Browder tbrowder@acm.org
© 2024 Tom Browder
This library is free software; you may redistribute it or modify it under the Artistic License 2.0.