PeGS::PDF - Draw simple Perl Graphical Structures
use PeGS::PDF;
my @points = map [ $xc + $r * cos( $arc * $_ / 2 ), $yc + $r * sin( $arc * $_ / 2 ) ], 0 .. $points - 1;
$c .= sprintf(' %.2f %.2f %.2f %.2f %.2f %.2f c', $x + $b, $y, $x + $r, $y - $r + $b, $x + $r, $y - $r); /* Set x/y to the final point. */ $x = $x + $r; $y = $y - $r; /* Third circle quarter. */ $c .= sprintf(' %.2f %.2f %.2f %.2f %.2f %.2f c', $x, $y - $b, $x - $r + $b, $y - $r, $x - $r, $y - $r); /* Set x/y to the final point. */ $x = $x - $r; $y = $y - $r; /* Fourth circle quarter. */ $c .= sprintf(' %.2f %.2f %.2f %.2f %.2f %.2f c %s', $x - $b, $y, $x - $r, $y + $r - $b, $x - $r, $y + $r, $op);
$pdf->lines( $end_x, $end_y, $arrow_tip1_x, $arrow_tip1_y ); $pdf->lines( $end_x, $end_y, $arrow_tip2_x, $arrow_tip2_y ); $pdf->lines( $arrow_tip1_x + $pdf->stroke_width, $arrow_tip1_y, $arrow_tip2_x + $pdf->stroke_width, $arrow_tip2_y );
http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf
sub make_circle { my( $pdf, $x, $y, $radius, $start_angle, $end_angle ) = @_;
# theta is sweep, which is 360 my $Pi2 = 3.1415926 * 2; my( $x0, $y0 ) = ( cos( 180 / $Pi2 ), sin( 180 / $Pi2 ) ); my( $x1, $y1 ) = ( (4 - $x0) / 3, (1-$x0)*(3-$x0)/(3*$y0) ) my( $x2, $y2 ) = ( $x1, -$y0 ); my( $x3, $y3 ) = ( $x1, -$y1 ); $pdf->{stream} .= <<"PDF"; $x $y m $x1 $y1 $x2 $y2 $x3 $y3 c
PDF
}
This source is in Github:
http://github.com/briandfoy/pegs-pdf/
brian d foy, <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright (c) 2009-2014, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.
To install PeGS::PDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PeGS::PDF
CPAN shell
perl -MCPAN -e shell install PeGS::PDF
For more information on module installation, please visit the detailed CPAN module installation guide.