r38200 - in /branches/upstream/libpdf-report-perl/current: ./ examples/ lib/PDF/

nhandler-guest at users.alioth.debian.org nhandler-guest at users.alioth.debian.org
Thu Jun 18 03:30:12 UTC 2009


Author: nhandler-guest
Date: Thu Jun 18 03:30:03 2009
New Revision: 38200

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38200
Log:
[svn-upgrade] Integrating new upstream version, libpdf-report-perl (1.33)

Added:
    branches/upstream/libpdf-report-perl/current/examples/openpdf.pl
Modified:
    branches/upstream/libpdf-report-perl/current/Changes
    branches/upstream/libpdf-report-perl/current/MANIFEST
    branches/upstream/libpdf-report-perl/current/META.yml
    branches/upstream/libpdf-report-perl/current/Makefile.PL
    branches/upstream/libpdf-report-perl/current/README
    branches/upstream/libpdf-report-perl/current/examples/barcode.pl
    branches/upstream/libpdf-report-perl/current/examples/footer.pl
    branches/upstream/libpdf-report-perl/current/examples/image.pl
    branches/upstream/libpdf-report-perl/current/examples/paragraph.pl
    branches/upstream/libpdf-report-perl/current/examples/piegraph.pl
    branches/upstream/libpdf-report-perl/current/examples/rotate.pl
    branches/upstream/libpdf-report-perl/current/lib/PDF/Report.pm

Modified: branches/upstream/libpdf-report-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/Changes?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/Changes (original)
+++ branches/upstream/libpdf-report-perl/current/Changes Thu Jun 18 03:30:03 2009
@@ -1,4 +1,9 @@
 Revision history for Perl extension PDF::Report.
+
+1.33  Wed Jun 17 09:38:16 EDT 2009
+  - Applied patch to make meta-info an instance variable and retrievable -
+    submitted by Sean Robinson
+  - Added examples/openpdf.pl (missing from the last version)
 
 1.32  Tue Jun  9 11:47:16 EDT 2009
   - Removed Test::Pod::Coverage from test.

Modified: branches/upstream/libpdf-report-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/MANIFEST?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/MANIFEST (original)
+++ branches/upstream/libpdf-report-perl/current/MANIFEST Thu Jun 18 03:30:03 2009
@@ -13,6 +13,7 @@
 examples/image.png
 examples/image.pnm
 examples/image.tif
+examples/openpdf.pl
 examples/paragraph.pl
 examples/piegraph.pl
 examples/rotate.pl

Modified: branches/upstream/libpdf-report-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/META.yml?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/META.yml (original)
+++ branches/upstream/libpdf-report-perl/current/META.yml Thu Jun 18 03:30:03 2009
@@ -1,14 +1,12 @@
 --- #YAML:1.0
 name:               PDF-Report
-version:            1.32
+version:            1.33
 abstract:           A wrapper written for PDF::API2
 author:
     - Andy Orr <aorr_at_cpan_dot_org>
 license:            unknown
 distribution_type:  module
 configure_requires:
-    ExtUtils::MakeMaker:  0
-build_requires:
     ExtUtils::MakeMaker:  0
 requires:
     PDF::API2:   0
@@ -17,7 +15,7 @@
     directory:
         - t
         - inc
-generated_by:       ExtUtils::MakeMaker version 6.52
+generated_by:       ExtUtils::MakeMaker version 6.46
 meta-spec:
     url:      http://module-build.sourceforge.net/META-spec-v1.4.html
     version:  1.4

Modified: branches/upstream/libpdf-report-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/Makefile.PL?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/Makefile.PL (original)
+++ branches/upstream/libpdf-report-perl/current/Makefile.PL Thu Jun 18 03:30:03 2009
@@ -1,17 +1,17 @@
-use strict;
-use warnings;
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
-    NAME                => 'PDF::Report',
-    AUTHOR              => 'Andy Orr <aorr_at_cpan_dot_org>',
-    VERSION_FROM        => 'lib/PDF/Report.pm',
-    ABSTRACT_FROM       => 'lib/PDF/Report.pm',
-    PL_FILES            => {},
-    PREREQ_PM => {
-        'PDF::API2' => 0,
-        'Test::More' => 0,
-    },
-    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
-    clean               => { FILES => 'PDF-Report-*' },
-);
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME                => 'PDF::Report',
+    AUTHOR              => 'Andy Orr <aorr_at_cpan_dot_org>',
+    VERSION_FROM        => 'lib/PDF/Report.pm',
+    ABSTRACT_FROM       => 'lib/PDF/Report.pm',
+    PL_FILES            => {},
+    PREREQ_PM => {
+        'PDF::API2' => 0,
+        'Test::More' => 0,
+    },
+    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+    clean               => { FILES => 'PDF-Report-*' },
+);

Modified: branches/upstream/libpdf-report-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/README?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/README (original)
+++ branches/upstream/libpdf-report-perl/current/README Thu Jun 18 03:30:03 2009
@@ -1,4 +1,4 @@
-Dist version 1.32
+Dist version 1.33
 ==================
 
 PDF::Report is written around Alfred Reibenschuh's PDF::API2.  It provides

Modified: branches/upstream/libpdf-report-perl/current/examples/barcode.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/barcode.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/barcode.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/barcode.pl Thu Jun 18 03:30:03 2009
@@ -1,53 +1,53 @@
-use lib qw(../lib);
-use PDF::Report;
-
-my $pdf = new PDF::Report(
-                          PageSize => "letter",
-                          PageOrientation => "portrait",
-                          undef => undef
-                         );
-
-$pdf->newpage(1);
-$pdf->setFont('Helvetica-bold');
-$pdf->setSize(16);
-my ($width, $height) = $pdf->getPageDimensions();
-
-$pdf->centerString(0, $width, $height-40, "Barcodes");
-
-my $x = $width/3;
-my $y = $height-150; 
-my @types = qw(3of9 code128 ean13 codabar 2of5int);
-
-my @codes = qw(010203045678909 ABCDEFabcdef012345 010203045678909 
-               384318530034967067 384318530034967067);
-
-my @scale = qw(.9 .5 .75 1 .8);
-
-$pdf->setFont('Helvetica');
-$pdf->setSize(10);
-
-my $next_line = 120;
-
-foreach my $nbr (0 .. $#types) {
-  if ($y < 50) {
-   $pdf->newpage(1);
-   $y = $height - 80;
-  }
-  if (($types[$nbr] eq '3of9ext') or ($types[$nbr] eq '3of9extchk')) {
-    $ext = 90506;
-  } 
-  $pdf->centerString(0, $width, $y+85, $types[$nbr]);
-  $pdf->drawBarcode($x, $y, $scale[$nbr], 1,
-                   $types[$nbr], $codes[$nbr], $ext, 
-                   10, 10, 50, 10, ' ', undef, 8, undef);
-  $y-=$next_line;
-  $ext = "";
-}
-
-my $outpdf = $0;
-$outpdf =~ s/pl$/pdf/;
-open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
-print PDF $pdf->Finish();
-close(PDF);
-
-exit;
+use lib qw(../lib);
+use PDF::Report;
+
+my $pdf = new PDF::Report(
+                          PageSize => "letter",
+                          PageOrientation => "portrait",
+                          undef => undef
+                         );
+
+$pdf->newpage(1);
+$pdf->setFont('Helvetica-bold');
+$pdf->setSize(16);
+my ($width, $height) = $pdf->getPageDimensions();
+
+$pdf->centerString(0, $width, $height-40, "Barcodes");
+
+my $x = $width/3;
+my $y = $height-150; 
+my @types = qw(3of9 code128 ean13 codabar 2of5int);
+
+my @codes = qw(010203045678909 ABCDEFabcdef012345 010203045678909 
+               384318530034967067 384318530034967067);
+
+my @scale = qw(.9 .5 .75 1 .8);
+
+$pdf->setFont('Helvetica');
+$pdf->setSize(10);
+
+my $next_line = 120;
+
+foreach my $nbr (0 .. $#types) {
+  if ($y < 50) {
+   $pdf->newpage(1);
+   $y = $height - 80;
+  }
+  if (($types[$nbr] eq '3of9ext') or ($types[$nbr] eq '3of9extchk')) {
+    $ext = 90506;
+  } 
+  $pdf->centerString(0, $width, $y+85, $types[$nbr]);
+  $pdf->drawBarcode($x, $y, $scale[$nbr], 1,
+                   $types[$nbr], $codes[$nbr], $ext, 
+                   10, 10, 50, 10, ' ', undef, 8, undef);
+  $y-=$next_line;
+  $ext = "";
+}
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish();
+close(PDF);
+
+exit;

Modified: branches/upstream/libpdf-report-perl/current/examples/footer.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/footer.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/footer.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/footer.pl Thu Jun 18 03:30:03 2009
@@ -1,36 +1,36 @@
-use lib qw(../lib);
-use PDF::Report;
-
-my $pdf = new PDF::Report(
-                          PageSize => [5.5*72, 8.5*72], # Custom page size 
-                          PageOrientation => "portrait"
-                         );
-
-$pdf->setFont('Helvetica');
-$pdf->setSize(12);
-my ($width, $height) = $pdf->getPageDimensions();
-my $y1 = $height - 30;
-my $x1 = 30;
-
-for (1 .. 4) {
-  $pdf->newpage();
-}
-
-my $outpdf = $0;
-$outpdf =~ s/pl$/pdf/;
-open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
-print PDF $pdf->Finish(\&footer);
-close(PDF);
-
-exit;
-
-sub footer {
-  my $pages = $pdf->pages;
-
-  $pdf->setFont("Times-roman");
-  $pdf->setSize(8);
-  for (1 .. $pages) {
-    $pdf->openpage($_);
-    $pdf->centerString($x1, $width-30, 10, "$_ out of $pages pages");
-  }
-}
+use lib qw(../lib);
+use PDF::Report;
+
+my $pdf = new PDF::Report(
+                          PageSize => [5.5*72, 8.5*72], # Custom page size 
+                          PageOrientation => "portrait"
+                         );
+
+$pdf->setFont('Helvetica');
+$pdf->setSize(12);
+my ($width, $height) = $pdf->getPageDimensions();
+my $y1 = $height - 30;
+my $x1 = 30;
+
+for (1 .. 4) {
+  $pdf->newpage();
+}
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish(\&footer);
+close(PDF);
+
+exit;
+
+sub footer {
+  my $pages = $pdf->pages;
+
+  $pdf->setFont("Times-roman");
+  $pdf->setSize(8);
+  for (1 .. $pages) {
+    $pdf->openpage($_);
+    $pdf->centerString($x1, $width-30, 10, "$_ out of $pages pages");
+  }
+}

Modified: branches/upstream/libpdf-report-perl/current/examples/image.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/image.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/image.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/image.pl Thu Jun 18 03:30:03 2009
@@ -1,33 +1,33 @@
-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();
-
-$y1-=70;
-
-foreach my $ext (qw(jpg gif tif png pnm)) {
-  $pdf->addImgScaled("image.$ext", 250, $y1, 1);
-  $y1-=70;
-}
-$y1-=70;
-$pdf->addImgScaled("image.jpg", 250, $y1, 2);
-
-my $outpdf = $0;
-$outpdf =~ s/pl$/pdf/;
-open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
-print PDF $pdf->Finish;
-close(PDF);
-
-exit;
+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();
+
+$y1-=70;
+
+foreach my $ext (qw(jpg gif tif png pnm)) {
+  $pdf->addImgScaled("image.$ext", 250, $y1, 1);
+  $y1-=70;
+}
+$y1-=70;
+$pdf->addImgScaled("image.jpg", 250, $y1, 2);
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish;
+close(PDF);
+
+exit;

Added: branches/upstream/libpdf-report-perl/current/examples/openpdf.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/openpdf.pl?rev=38200&op=file
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/openpdf.pl (added)
+++ branches/upstream/libpdf-report-perl/current/examples/openpdf.pl Thu Jun 18 03:30:03 2009
@@ -1,0 +1,27 @@
+use lib qw(../lib);
+use PDF::Report;
+
+my $file = $ARGV[0];
+print "Pass me a PDF file." if ! -e $file;
+
+my $pdf = new PDF::Report(
+                          File => $file,
+                          undef => undef
+                         );
+
+$pdf->openpage(1);
+
+$pdf->setFont('Helvetica');
+$pdf->setSize(12);
+
+my ($pageW, $pageH) = $pdf->getPageDimensions();
+$pdf->shadeRect(30, $pageH-5, 200, $pageH-30, 'grey');
+$pdf->addRawText("Document opened successfully", 32, $pageH-22, 'red');
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish();
+close(PDF);
+ 
+exit;

Modified: branches/upstream/libpdf-report-perl/current/examples/paragraph.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/paragraph.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/paragraph.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/paragraph.pl Thu Jun 18 03:30:03 2009
@@ -1,42 +1,42 @@
-use lib qw(../lib);
-use PDF::Report;
-
-my $pdf = new PDF::Report(
-                          PageSize => "letter",
-                          PageOrientation => "portrait",
-                          undef => undef
-                         );
-
-$pdf->newpage(1);
-$pdf->setFont('Helvetica-bold');
-$pdf->setSize(16);
-my ($width, $height) = $pdf->getPageDimensions();
-
-$pdf->centerString(0, $width, $height-40, "Paragraph");
-
-$pdf->setFont('Helvetica');
-$pdf->setSize(10);
-
-my $text1= 
-"A doctor, an architect, and a computer scientist were arguing about whose profession was the oldest.  In the course of their arguments, they got all the way back to the Garden of Eden, whereupon the doctor said, \"The medical profession is clearly the oldest, because Eve was made from Adam's rib, as the story goes, and that was a simply incredible surgical feat.\"";
-
-my $text2=
-        "The architect did not agree.  He said, \"But if you look at the Garden 
-itself, in the beginning there was chaos and void, and out of that the Garden 
-and the world were created.  So God must have been an architect.\"";
-
-my $text3=
-        "The computer scientist, who'd listened carefully to all of this, then 
-commented, \"Yes, but where do you think the chaos came from?\"";
-
-$pdf->addParagraph($text1, 30, $height-70, $width-60, 30, 25, 10);
-$pdf->addParagraph($text2, 30, $height-100, $width-60, 20, 25, 10);
-$pdf->addParagraph($text3, 30, $height-120, $width-60, 20, 25, 10);
-
-my $outpdf = $0;
-$outpdf =~ s/pl$/pdf/;
-open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
-print PDF $pdf->Finish();
-close(PDF);
- 
-exit;
+use lib qw(../lib);
+use PDF::Report;
+
+my $pdf = new PDF::Report(
+                          PageSize => "letter",
+                          PageOrientation => "portrait",
+                          undef => undef
+                         );
+
+$pdf->newpage(1);
+$pdf->setFont('Helvetica-bold');
+$pdf->setSize(16);
+my ($width, $height) = $pdf->getPageDimensions();
+
+$pdf->centerString(0, $width, $height-40, "Paragraph");
+
+$pdf->setFont('Helvetica');
+$pdf->setSize(10);
+
+my $text1= 
+"A doctor, an architect, and a computer scientist were arguing about whose profession was the oldest.  In the course of their arguments, they got all the way back to the Garden of Eden, whereupon the doctor said, \"The medical profession is clearly the oldest, because Eve was made from Adam's rib, as the story goes, and that was a simply incredible surgical feat.\"";
+
+my $text2=
+        "The architect did not agree.  He said, \"But if you look at the Garden 
+itself, in the beginning there was chaos and void, and out of that the Garden 
+and the world were created.  So God must have been an architect.\"";
+
+my $text3=
+        "The computer scientist, who'd listened carefully to all of this, then 
+commented, \"Yes, but where do you think the chaos came from?\"";
+
+$pdf->addParagraph($text1, 30, $height-70, $width-60, 30, 25, 10);
+$pdf->addParagraph($text2, 30, $height-100, $width-60, 20, 25, 10);
+$pdf->addParagraph($text3, 30, $height-120, $width-60, 20, 25, 10);
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish();
+close(PDF);
+ 
+exit;

Modified: branches/upstream/libpdf-report-perl/current/examples/piegraph.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/piegraph.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/piegraph.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/piegraph.pl Thu Jun 18 03:30:03 2009
@@ -1,30 +1,30 @@
-use lib qw(../lib);
-use PDF::Report;
-
-my $pdf = new PDF::Report(
-                          PageSize => "letter",
-                          PageOrientation => "portrait",
-                          undef => undef
-                         );
-
-$pdf->newpage(1);
-$pdf->setFont('Helvetica-bold');
-$pdf->setSize(16);
-my ($width, $height) = $pdf->getPageDimensions();
-
-$pdf->centerString(0, $width, $height-40, "Big Pie Graph");
-
-my @data = qw(2 4 3 2 3 5 2 4 2 3 4 5 3 4 3 5 4 2 4 3 4);
-my @labels;
-for (0 .. $#data) {
-  push(@labels, "label" . $_);  
-} 
-$pdf->drawPieGraph($width/2, $height-200, 100, \@data, \@labels);
-
-my $outpdf = $0;
-$outpdf =~ s/pl$/pdf/;
-open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
-print PDF $pdf->Finish();
-close(PDF);
- 
-exit;
+use lib qw(../lib);
+use PDF::Report;
+
+my $pdf = new PDF::Report(
+                          PageSize => "letter",
+                          PageOrientation => "portrait",
+                          undef => undef
+                         );
+
+$pdf->newpage(1);
+$pdf->setFont('Helvetica-bold');
+$pdf->setSize(16);
+my ($width, $height) = $pdf->getPageDimensions();
+
+$pdf->centerString(0, $width, $height-40, "Big Pie Graph");
+
+my @data = qw(2 4 3 2 3 5 2 4 2 3 4 5 3 4 3 5 4 2 4 3 4);
+my @labels;
+for (0 .. $#data) {
+  push(@labels, "label" . $_);  
+} 
+$pdf->drawPieGraph($width/2, $height-200, 100, \@data, \@labels);
+
+my $outpdf = $0;
+$outpdf =~ s/pl$/pdf/;
+open(PDF, "> $outpdf") or die "Error opening $outpdf: $!\n";
+print PDF $pdf->Finish();
+close(PDF);
+ 
+exit;

Modified: branches/upstream/libpdf-report-perl/current/examples/rotate.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/examples/rotate.pl?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/examples/rotate.pl (original)
+++ branches/upstream/libpdf-report-perl/current/examples/rotate.pl Thu Jun 18 03:30:03 2009
@@ -1,28 +1,28 @@
-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;
+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;

Modified: branches/upstream/libpdf-report-perl/current/lib/PDF/Report.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpdf-report-perl/current/lib/PDF/Report.pm?rev=38200&op=diff
==============================================================================
--- branches/upstream/libpdf-report-perl/current/lib/PDF/Report.pm (original)
+++ branches/upstream/libpdf-report-perl/current/lib/PDF/Report.pm Thu Jun 18 03:30:03 2009
@@ -2,13 +2,13 @@
 # This is a wrapper for Alfred Reibenschuh's PDF::API2
 # Defines methods to create PDF reports
 # By: Andy Orr
-# Date: 06/09/2009
-# Version: 1.32
+# Date: 06/17/2009
+# Version: 1.33
 ###############################################################################
 
 package PDF::Report;
 
-$VERSION = "1.32"; 
+$VERSION = "1.33"; 
 
 =head1 PDF::Report 
 
@@ -43,16 +43,6 @@
 my $DATE=sprintf "%02d/%02d/%04d", ++$month, $day, 1900 + $year;
 
 # Document info
-my %INFO = 
-          (
-            Creator => "None",
-            Producer => "None",
-            CreationDate => $DATE,
-            Title => "Untitled",
-            Subject => "None",
-            Author => "Auto-generated",
-          );
-
 my @parameterlist=qw(
         PageSize
         PageWidth
@@ -151,6 +141,14 @@
               FtrFontSize  => 11,
               MARGIN_DEBUG => 0,
               PDF_API2_VERSION => $PDF::API2::VERSION,
+              INFO => {
+                Creator => "None",
+                Producer => "None",
+                CreationDate => $DATE,
+                Title => "Untitled",
+                Subject => "None",
+                Author => "Auto-generated",
+              },
 
               ########################################################
               # Cache for font object caching -- used by setFont() ###
@@ -1004,17 +1002,32 @@
   my ($self, %info) = @_;
 
   # Over-ride or define %INFO values
-  foreach my $key (keys %INFO) {
-    if (length($info{$key}) and ($info{$key} ne $INFO{$key})) {
-      $INFO{$key} = $info{$key};
+  foreach my $key (keys %{$self->{INFO}}) {
+    if (length($info{$key}) and ($info{$key} ne ${$self->{INFO}}{$key})) {
+      ${$self->{INFO}}{$key} = $info{$key};
     } 
   }
-  my @orig_keys = keys(%INFO);
+  my @orig_keys = keys(%{$self->{INFO}});
   foreach my $key (keys %info) {
     if (! grep /$key/, @orig_keys) {
-      $INFO{$key} = $info{$key};
+      ${$self->{INFO}}{$key} = $info{$key};
     }
   }
+}
+
+=item %infohash = $pdf->getInfo();
+
+Gets meta-data from the info structure of the document.
+Valid keys for %infohash: Creator, Producer, CreationDate,
+Title, Subject, Author, etc.
+
+=cut
+
+sub getInfo {
+  my $self = shift;
+
+  my %info = $self->{pdf}->info();
+  return %info;
 }
 
 =item $pdf->saveAs($fileName);
@@ -1035,7 +1048,7 @@
   my $self = shift;
   my $fileName = shift;
 
-  $self->{pdf}->info(%INFO);
+  $self->{pdf}->info(%{$self->{INFO}});
   $self->{pdf}->saveas($fileName);
   $self->{pdf}->end();
 }
@@ -1070,7 +1083,7 @@
     &gen_page_footer($self, $total, $callback);
   }
 
-  $self->{pdf}->info(%INFO);
+  $self->{pdf}->info(%{$self->{INFO}});
   my $out = $self->{pdf}->stringify;
 
   return $out;




More information about the Pkg-perl-cvs-commits mailing list