File: 03_autoflow.pl

package info (click to toggle)
libpdf-api2-simple-perl 1.1.4u-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 823; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 734 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
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl

BEGIN { push @INC, '../lib'; }

use PDF::API2::Simple;

my $pdf = PDF::API2::Simple->new( 
				  file => '03_autoflow.pdf',
				  line_height => 20,
				  margin_left => 5,
				  margin_top => 5,
				  margin_right => 5,
				  margin_bottom => 5
				  );

$pdf->add_font('VerdanaBold');
$pdf->add_font('Verdana');
$pdf->add_page();

$pdf->next_line;

$pdf->text( 'Demonstrating Text', 
	    x => ($pdf->width / 2),
	    font => 'VerdanaBold',
	    font_size => 12,
	    align => 'center' );

$pdf->set_font( 'Verdana' );

$pdf->next_line;
$pdf->next_line;

for (my $i = 0; $i < 250; $i++) {
    my $text = "$i - All work and no play makes Jack a dull boy";

    $pdf->text($text, autoflow => 'on');
}

$pdf->save();