File: 040_annotation

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 (30 lines) | stat: -rw-r--r-- 576 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
#!/usr/bin/perl

use lib '../lib';
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);

$gfx=$page->gfx;
$gfx->textlabel(50,700,$f2,20,'Hello World!',-color=>'red');

$ant=$page->annotation;
$ant->text("This is an open note.\nnext line", -rect=>[0,0,100,100], -open=>1);

$ant=$page->annotation;
$ant->text('This is an closed note', -rect=>[100,100,200,200]);

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

exit;

__END__