view release on metacpan or search on metacpan
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
$annotation->text($text, %opts)
=over
Defines the annotation as a text note with content string C<$text> and
options %opts (common parameters, text, open: see descriptions below).
The C<$text> may include newlines \n for multiple lines. Note that the option
'border' is ignored, since an I<icon> is used.
The option C<text> is the popup's label string, not to be confused with the
main C<$text>.
The icon appears in the upper left corner of the C<rect> selection rectangle,
and its active clickable area is fixed by the icon (it is I<not> equal to the
rectangle). The icon size is fixed, and its fill color set by C<color>.
Additional options:
=back
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
# copy dashed names over to preferred non-dashed names
%opts = dashed2nondashed(%opts);
$self->{'Subtype'} = PDFName('Text');
$self->content($text);
$self->rect(@{$opts{'rect'}}) if defined $opts{'rect'};
$self->Color(@{$opts{'color'}}) if defined $opts{'color'};
#$self->border($opts{'border'}) if defined $opts{'border'}; # ignored
$self->open($opts{'open'}) if defined $opts{'open'};
# popup label (title)
# have seen /T as (xFEFF UTF-16 chars)
$self->{'T'} = PDFString($opts{'text'}, 'p') if exists $opts{'text'};
# icon opacity?
if (defined $opts{'opacity'}) {
$self->{'CA'} = PDFNum($opts{'opacity'});
}
# Icon Name will be ignored if there is an AP.
my $icon; # perlcritic doesn't want 2 lines combined
$icon = $opts{'icon'} if exists $opts{'icon'};
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
=head3 markup
$annotation->markup($text, $PointList, $highlight, %opts)
=over
Defines the annotation as a text note with content string C<$text> and
options %opts (color, text, open, opacity: see descriptions below).
The C<$text> may include newlines \n for multiple lines.
C<text> is the popup's label string, not to be confused with the main C<$text>.
There is no icon. Instead, the annotated text marked by C<$PointList> is
highlighted in one of four ways specified by C<$highlight>.
=back
=over
=item $PointList => [ 8n numbers ]
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
my $minY = min($pointList[1], $pointList[3], $pointList[5], $pointList[7]);
my $maxY = max($pointList[1], $pointList[3], $pointList[5], $pointList[7]);
$self->rect($minX-.5,$minY-.5, $maxX+.5,$maxY+.5);
$self->open($opts{'open'}) if defined $opts{'open'};
if (defined $opts{'color'}) {
$self->Color(@{$opts{'color'}});
} else {
$self->Color([]);
}
# popup label (title)
# have seen /T as (xFEFF UTF-16 chars)
$self->{'T'} = PDFString($opts{'text'}, 'p') if exists $opts{'text'};
# opacity?
if (defined $opts{'opacity'}) {
$self->{'CA'} = PDFNum($opts{'opacity'});
}
return $self;
}
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
$annotation->movie($file, $contentType, %opts)
=over
Defines the annotation as a movie from C<$file> with
content (MIME) type C<$contentType> and
options %opts (common parameters, text: see descriptions below).
The C<rect> rectangle B<also serves as the area where the movie is played>, so
it should be of usable size and aspect ratio. It does not use a separate popup
player. It is known to play .avi and .wav files -- others have not been tested.
Using Adobe Reader, it will not play .mpg files (unsupported type). More work
is probably needed on this annotation method.
=back
=cut
sub movie {
my ($self, $file, $contentType, %opts) = @_;
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
#$self->{'Movie'}->{'F'} = PDFDict();
#$self->{' apipdf'}->new_obj($self->{'Movie'}->{'F'});
#my $f = $self->{'Movie'}->{'F'};
#$f->{'Type'} = PDFName('EmbeddedFile');
#$f->{'Subtype'} = PDFName($contentType);
#$f->{' streamfile'} = $file;
$self->rect(@{$opts{'rect'}}) if defined $opts{'rect'};
$self->border(@{$opts{'border'}}) if defined $opts{'border'};
$self->Color(@{$opts{'color'}}) if defined $opts{'color'};
# popup label (title) DOESN'T SEEM TO SHOW UP ANYWHERE
# self->A->T and self->T also fail to display
$self->{'Movie'}->{'T'} = PDFString($opts{'text'}, 'p') if exists $opts{'text'};
return $self;
}
=head3 file_attachment
$annotation->file_attachment($file, %opts)
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
ranges from 0.0 (transparent) to 1.0 (fully opaque), and applies to both
the outline and the fill color. The default is 1.0.
=item notrimpath => 1
If given, show the entire path and file name on mouse rollover, rather than
just the file name.
=item text => string
A text label for the popup (on mouseover) that contains the file name.
=back
Note that while PDF permits different specifications (paths) to DOS/Windows,
Mac, and Unix (including Linux) versions of a file, and different format copies
to be embedded, at this time PDF::Builder only permits a single file (format of
your choice) to be embedded. If there is user demand for multiple file formats
to be referenced and/or embedded, we could look into providing this, I<although
separate OS version paths B<may> be considered obsolescent!>.
lib/PDF/Builder/Annotation.pm view on Meta::CPAN
$self->{'FS'}->{'EF'}->{'F'}->{' streamfile'} = $file;
# Set the icon appearance
$self->icon_appearance($icon, %opts) if $icon;
return $self;
}
# TBD additional annotation types without icons
# free text, line, square, circle, polygon (1.5), polyline (1.5), highlight,
# underline, squiggly, strikeout, caret (1.5), ink, popup, sound, widget,
# screen (1.5), printermark, trapnet, watermark (1.6), 3D (1.6), redact (1.7)
# TBD additional annotation types with icons
# stamp
# icons: Approved, Experimental, NotApproved, Asis, Expired,
# NotForPublicRelease, Confidential, Final, Sold, Departmental,
# ForComment, TopSecret, Draft (def.), ForPublicRelease
# sound
# icons: Speaker (def.), Mic
lib/PDF/Builder/Basic/PDF/Utils.pm view on Meta::CPAN
=item 'n'
A B<named destination>, where UTF-8 text is permitted.
=item 'o'
An B<outline title>, where UTF-8 text is permitted.
=item 'p'
A B<popup title>, where UTF-8 text is permitted.
=item 'm'
B<metadata>, where UTF-8 text is permitted.
=item 'f'
A B<file path and/or name>, where UTF-8 text is currently B<not> permitted.
=item 'u'
lib/PDF/Builder/Content/Column_docs.pm view on Meta::CPAN
prepend a C<E<lt>styleE<gt>> HTML tag, with CSS markup, to your Markdown source.
Standard Markdown permits an 'id' to be defined in a heading, by suffixing the
text with C<{#id_name}>. This is equivalent to C<id="id_name"> in HTML markup.
Although Text::Markdown does not currently support it, C<column()> implements
this way of defining a target's id, and in fact extends it to permit an id to
be defined for any tag with child text.
Markdown is further extended by C<column()> to permit a 'title' to be defined
for any tag with child text, by use of C<{^title_text}>. Note that this 'title'
is the I<link title> to be used, B<not> browser style "hover" popup text. It is
the equivalent of C<title="title_text"> in E<lt>a> or E<lt>_ref> HTML markup.
Any link tag may define the PDF "fit" to use at the target, by
C<{%fit_type,parm(s)}> or C<fit="fit_type,parm(s)"> in E<lt>a> or E<lt>_ref>
HTML markup.
There are other HTML equivalents defined by Standard Markdown which may not
be implemented (converted) by Text::Markdown. Among these are C<~~> line-through
(strike-out) and C<===> horizontal rule, which have been fixed with
post-processing of the generated HTML. Let us know if you find any more such
cases, and we may be able to extend the functionality of 'md1' formatting, or
lib/PDF/Builder/Content/Column_docs.pm view on Meta::CPAN
specific x and y), the upper left corner of the target window is placed these
amounts (units I<points>) from the left (delta x) and top (delta y) edges of
the target text. The default is 20 (points) each, roughly a couple of lines'
worth. The left side is limited to the page edge, and the top side is limited
to the page top.
Note that the upper edge of the text is where the I<previous> line left off,
so if there is a top margin on the target text (e.g., it's a heading), the
offset will be from there, not the text itself, and the view window may
therefore be up higher on the page than you would otherwise expect. This has
been known to confuse users with a PDF Reader which displays a fixed-size popup
window showing the target a link will go to, which might even miss the target
text entirely if the deltas are too large.
=back
=back
If all references include their own title string and do B<not> show a page
(only the title string as the annotation link text), a document should take
only one pass. Often two passes are enough to resolve even forward references