File: 020_textrise

package info (click to toggle)
libpdf-api2-perl 2.019-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 20,264 kB
  • sloc: perl: 42,313; sh: 23; makefile: 9
file content (47 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (2)
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

use PDF::API2;
use PDF::API2::Util;


$pdf=PDF::API2->new;

$f1=$pdf->corefont('Helvetica',-encode=>'latin1');
$f2=$pdf->corefont('Helvetica-Bold',-encode=>'latin1');

$page = $pdf->page;
$page->mediabox(595,842);

$txt=$page->text;
$txt->font($f1,20);

$txt->translate(50,800);
$txt->text('normal text');
$txt->rise(5);
$txt->text('rise = 5 units');
$txt->rise(-5);
$txt->text('rise = -5 units');
$txt->rise(0);

$txt->translate(50,600);
$txt->text('normal text');
$txt->rise(10);
$txt->text('rise = 10 units');
$txt->rise(-10);
$txt->text('rise = -10 units');
$txt->rise(0);

$txt->translate(50,400);
$txt->text('normal text');
$txt->rise(20);
$txt->text('rise = 20 units');
$txt->rise(-20);
$txt->text('rise = -20 units');
$txt->rise(0);

$pdf->saveas("$0.pdf");
$pdf->end();

exit;

__END__