File: rotate.pl

package info (click to toggle)
libpdf-report-perl 1.36-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 260 kB
  • sloc: perl: 791; makefile: 10
file content (29 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl
use lib qw(../lib);
use PDF::Report;

my $pdf = new PDF::Report(
                          PageSize => "LETTER", 
                          PageOrientation => "portrait",
                          undef => undef
                         );

$pdf->setFont('Helvetica');
$pdf->setSize(12);
my ($width, $height) = $pdf->getPageDimensions();
my $y1 = $height - 30;
my $x1 = 30;

$pdf->newpage();

# Add some text with rotate, and let's throw in some color for the fun of it
$pdf->addRawText("This is some text of a different color, rotated.", 
                 $x1+200, $y1-300, 'green', '', '', 315);

my $outpdf = $0;
$outpdf =~ s/pl$/pdf/;
open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
print PDF $pdf->Finish;
close(PDF);

exit;