Thread PDF::Table Anzahl der Zeilen pro seite begrenzt? (13 answers)
Opened by Gast at 2008-02-18 15:32

nepos
 2008-02-19 17:01
#106112 #106112
User since
2005-08-17
1420 articles
BenutzerIn
[Homepage] [default_avatar]
Hm, also wenn ich deinen Code so ändere, krieg ich ein korrektes PDF. Allerdings auch einige Warnings, da -w die Breite ist und mit 85 bisschen klein ist:
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/perl 

use strict;
use warnings;

use PDF::API2;
use PDF::Table;
my $pdf        = new PDF::API2( -file => "table.pdf" );
my $pdftable1  = new PDF::Table;
my $page       = $pdf->page;
my $col_props1 = [
  {
    min_w   => 36,
    justify => 'left',
  },
  {
    min_w            => 36,
    justify          => 'left',
    background_color => '#FFFF00',

  },
  {
    min_w   => 36,
    justify => 'left',
  },
  {
    min_w   => 41,
    justify => 'left',
  },
];
my $some_data = [
  [ "test1", "3", "3", "3", "3", "3", "3" ],
  [ "test2", "3", "3", "3", "3", "3", "3" ],
  [ "test3", "3", "3", "3", "3", "3", "3" ],
  [ "test4", "3", "3", "3", "3", "3", "3" ],
  [ "test5", "3", "3", "3", "3", "3", "3" ],
];
$pdftable1->table(

  # required params
  $pdf,
  $page,
  $some_data,
  x       => 50,
  start_y => 215,
  next_y  => 0,
  start_h => 400,
  next_h  => 0,

  # some optional params
  w             => 85,
  padding       => 5,
  padding_right => 1,
  padding_left  => 5,
  font          => $pdf->corefont("Helvetica Bold"),
  font_size     => 4,
  column_props  => $col_props1,

  #-cell_props     => $row_props
  #cell background color for even rows
);
$pdf->save();

View full thread PDF::Table Anzahl der Zeilen pro seite begrenzt?