File: XObject.pm

package info (click to toggle)
libpdf-api2-perl 2.048-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,228 kB
  • sloc: perl: 42,239; makefile: 11
file content (53 lines) | stat: -rw-r--r-- 778 bytes parent folder | download
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
48
49
50
51
52
53
package PDF::API2::Resource::XObject;

use base 'PDF::API2::Resource';

use strict;
use warnings;

our $VERSION = '2.048'; # VERSION

use PDF::API2::Basic::PDF::Utils;

=head1 NAME

PDF::API2::Resource::XObject - Base class for external objects

=head1 METHODS

=over

=item $xobject = PDF::API2::Resource::XObject->new($pdf, $name)

Creates an XObject resource.

=cut

sub new {
    my ($class, $pdf, $name) = @_;
    my $self = $class->SUPER::new($pdf, $name);

    $self->type('XObject');

    return $self;
}

=item $type = $xobject->subtype($type)

Get or set the Subtype of the XObject resource.

=cut

sub subtype {
    my $self = shift();
    if (scalar @_) {
        $self->{'Subtype'} = PDFName(shift());
    }
    return $self->{'Subtype'}->val();
}

=back

=cut

1;