Re: Re: Underline text
"Mr. Shawn H. Corey" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <[email protected]> |
turnertim wrote:
> I'm sorry I have looked at the -underline explanation in Content and
> have tried the following code:
>
> $txt1->text("Some text to underline",-underline=>[2,1]);
>
> And it draws without error but with no underline.
> Anything obvious that I'm doing wrong in that syntax?
I don't see anything wrong with your code. Of course, having only one line of code makes it hard to judge. Try the following to see if it works. It does on my machine; so if it fails, we look for differences between our machines.
#!/usr/bin/perl
use strict;
use warnings;
use PDF::API2;
my $pdf = new PDF::API2;
my $page = $pdf->page;
my $typeface = $pdf->corefont( 'Times-Roman' );
my $text = $page->text;
$text->font( $typeface, 12 );
$text->translate( 72, 720 );
$text->text( 'Hello, world', -underline=>[2,1] );
$text->translate( 72, 648 );
$text->text( 'Hello, world', -underline=>['auto','auto'] );
$pdf->saveas( 'foo.pdf' );
__END__
--
Just my 0.00000002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle