PDF-API2-Simple

 view release on metacpan or  search on metacpan

lib/PDF/API2/Simple.pm  view on Meta::CPAN


# public methods - layout
# ================================================

=head2 Layout

These methods modify the actual layout of the PDF. Note that most of these methods set some internal state. Most often, the last C<x> and C<y> are set after the rendered object.

Most times, underscores may be stripped and the arguments will still work, such as is the difference between C<fill_color>, and C<fillcolor>.

=head3 popup C<text>[, C<%opts>]

Creates a 25x25 box at C<opts{x}> (or the current C<x>), C<opts{y}> (or the current C<y>) to represent an annotation at that point. The user may then click that icon for a full annotation.

=cut

sub popup {
  my ($self, $text, %opts) = @_;
  my $x = exists $opts{'x'} ? $opts{'x'} : $self->x;
  my $y = exists $opts{'y'} ? $opts{'y'} : $self->y;
  my $annotation = $self->current_page->annotation;
  
  $annotation->rect( $x, $y, $x + 25, $y + 25 );
  $annotation->text( $text );
}

=head3 url



( run in 0.984 second using v1.01-cache-2.11-cpan-364913b4093 )