Bug Fixing:
[koha.git] / barcodes / test.textblock.pl
1 #!/usr/bin/perl
2
3 use C4::Context;
4 use PDF::API2;
5 use PDF::Table;
6
7 my $pdftable = new PDF::Table;
8 my $pdf      = PDF::API2->new();
9
10 #$pdf->mediabox(612,792);
11 my $fnt  = $pdf->corefont('Helvetica-Bold');
12 my $page = $pdf->page;                         # returns the last page
13 my $txt  = $page->text;
14 $txt->{' font'} = $fnt;
15 $text_to_place = "moo moo";
16
17 ( $width_of_last_line, $ypos_of_last_line, $left_over_text ) =
18   $pdftable->text_block(
19     $txt,
20     $text_to_place,
21     -x => 100,
22     -y => 300,
23     -w => 50,
24     -h => 40,
25
26     #   -lead     => 13,
27     #   -font_size => 12,
28     # -parspace => 0,
29     #   -align    => "left",
30     #   -hang     => 1,
31   );
32
33 $pdf->saveas("$htdocs_path/barcodes/foo.pdf");