API2 wrapper?
Ben <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <19609413.1188568005937.JavaMail.root@elwamui-darkeyed.atl.sa.earthlink.net> |
I am trying to make a wrapper for API2 , because in my job we use that amoung other modules and i was told to make a module that incases all of them so the other developers (which do not know perl)
can use this module to do all task with greater ease, I started with the API2 module and I beieve I am getting pretty far on it (understanding wise) this is my first module so I need some help understand a few issues
I got the module to stringify a pdf with one line of text which worked (somereason doesn't now?) but when it did it printed the next text on another page
this is my methods to try and talk with API2 objects
sub stringPDF{
my $self = shift;
if (@_) {
$self->{'_pdf'}->stringify = shi
ft;
}
return $self->{'_pdf'}->stringify;
#$self->{pdf}->stringify;
#$self->{pdf}->end;
}
sub pdf {
my $self = shift;
if (@_) {
$self->{'_pdf'} = shift;
}
return $self->{'_pdf'};
}
sub page {
my $self = shift;
if (@_) {
$self->{'_pdf'}->page = shift;
}
return $self->{'_pdf'}->page;
}
for the most part I think they are working and I am not quite sure why its now failing. this is the text sub we are using to right text
sub newText{
my ($self, $font, $weight, $font
size, $fontColor, $x, $y, $text) = @_;
my %font = (
Helvetica => {
Bold => $self->pdf->corefont('Helvetica-Bold', -encoding => 'utf-8'),
Roman => $self->pdf->corefont('Helvetica', -encoding => 'utf-8'),
Italic => $self->pdf->corefont('Helvetica-Oblique', -encoding => 'utf-8'),
},
Futura => {
 
; Bold => $self->pdf->ttfont('FtraHv__.ttf', -encoding => 'utf-8'),
Medium => $self->pdf->ttfont('FtraMd__.ttf', -encoding => 'utf-8'),
Lite => $self->pdf->ttfont('FtraLt__.ttf', -encoding => 'utf-8'),
},
);
my $text = $self->pdf->page->text;
$text->font( $font{$font}{$weight}, $fontsize );
$text->fillcolor( $fontColor );
&nbs
p; $text->translate( $x, $y );
$text->text( $text );
}
any Ideas on what I might be doing wrong???
thanks
__._,_.___
Messages in this topic (1)
Reply (via web post) |
Start a new topic
Messages
| Polls
| Members
To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@public.gmane.org
http://groups.yahoo.com/;_ylc=X3oDMTJkdDVpdjRpBF9TAzk3NDc2NTkwBGdycElkAzIwMTczODIEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMTg4NTY4MDM5
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group |
Yahoo! Groups Terms of Use |
Unsubscribe
Visit Your Group
Ads on Yahoo!
Learn more now.
Reach customers
searching for you.
Y! Messenger
All together now
Host a free online
conference on IM.
Fitness Edge
on Yahoo! Groups
Learn how to
increase endurance.
.
__,_._,___