Thread perl:reuse unter Win7 32 bit - Fehler allgemein und PDF wird geleert (5 answers)
Opened by jan99 at 2015-04-28 16:07

jan99
 2015-04-28 16:07
#180864 #180864
User since
2008-09-18
439 Artikel
BenutzerIn
[default_avatar]
Moin !

ich bin nun endlich mal wieder dabei mich mit pdf:reuse unter strawberry-perl (win7 32bit) auseinander zu setzen.

Es geht um das Beispiel Reusing Existing PDF Files aus der Seite http://www.perl.com/pub/2007/09/20/pdf-processing-...

Folgendes Protokoll bekomme ich:
Quote
C:\Perl-Tools\FSK-Nummern-Schreiben>perl reuse-letter.pl
defined(@array) is deprecated at C:/strawberry/perl/site/lib/PDF/Reuse.pm line 9
93.
(Maybe you should just omit the defined()?)
defined(@array) is deprecated at C:/strawberry/perl/site/lib/PDF/Reuse.pm line 9
93.
(Maybe you should just omit the defined()?)
An error occurred
at reuse-letter.pl line 19.
The file sample-letter.pdf can't be found, aborts
More information might be found in
error.log
at reuse-letter.pl line 19.

C:\Perl-Tools\FSK-Nummern-Schreiben>pause
Drücken Sie eine beliebige Taste . . .


wobei die ersten Meldungen auch bei dem ersten Beispiel aus o.g. Seite kommt.

Zudem wird die sample-letters.pdf von 52kb auf 1kb reduziert - quasi geleert.

Kann mir einer weiterhelfen?

Gruß Jan

Damit man weiß wie die Zeilennummern zuzuordnen sind hier noch mein Code:
Code (perl): (dl )
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
#http://www.perl.com/pub/2007/09/20/pdf-processing-with-perl.html
# file: examples/reuse-letter.pl
  use PDF::Reuse;
  use Date::Formatter;
  use strict;

  my $date = Date::Formatter->now();
  $date->createDateFormatter("(DD).(MM). (YYYY)");

  my $n      =  1;
  my $incr   = 14;
  my $infile = 'customer.txt';

  prFile("sample-letters.pdf");

  prCompress(1);
  prFont('Arial');
  prForm("sample-letter.pdf");

  open (my $fh, "<$infile") || die "Couldn't open $infile, $!\n aborts!\n";

  while (my $line = <$fh>)  {
      my $x = 60;
      my $y = 760;

      my ($first, $last, $street, $zipCode, $city, $country) = split(/,/, $line);
      last unless $country;

      prPage() if $n++ > 1 ;
      prText($x, $y, "$first $last");

      $y -= $incr;
      prText($x, $y, $street);

      $y -= $incr;
      prText($x, $y, $zipCode);
      prText(($x + 40), $y, $city);

      $y -= $incr;
      prText($x,   $y, $country);
      prText(60,  600, "Dear $first $last,");
      prText(400, 630, "Berlin, $date");
  }

  prEnd();
  close $fh;
perl-Greenhorn - Win7 64bit / strawberry (ehem. activeperl) - www.OpenStreetMap.de

View full thread perl:reuse unter Win7 32 bit - Fehler allgemein und PDF wird geleert