osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: infinite loop in text->paragraph (0.40.91)
- msg#00037

List: lang.perl.modules.pdfapi2

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index


On Tuesday, February 15, 2005, at 04:24 AM, Markus Maier wrote:
> Hi,
>
> I got stuck here after upgrading from 0.30r77 to 0.40.91. The
> following code
> worked fine under 0.30r77 but ends up in an infinite loop in the
> text->paragraph method under 0.40.91.
>
> ----------
> #!/usr/bin/perl -w
>
> use strict;
> use PDF::API2;
>
> my $pdf = PDF::API2->new(-file => 'test.pdf');
> my $page = $pdf->page();
> my $text = $page->text();
> my $font = $pdf->corefont('Verdana', -encode => 'latin1');
>
> $text->font($font, 8);
>
> $text->paragraph("Hello, just a test."x10, -x => 300, -y => 600, -h =>
> 600,
> -w => 200);
>
> $pdf->save();
>
> exit();
> ----------
>
> Anyone any idea?
>
> Cheers,
>
> Markus

Yes, plenty. Replace the paragraph call with:

$text->translate( 300, 600 );
$overflow = $text->paragraph( "Hello, just a test. "x10, 200, 600 );

From perldoc PDF::API2::Content:
$overflow_text = $txt->paragraph $text, $width, $height, %options
** DEVELOPER METHOD **

DEVELOPER METHOD means:
1. This method may not do anything useful.
2. This method may erase your hard disk(s).
3. This method may erase the hard disks on any machine your machine is
connected to.
4. This method is subjected to change *without* notice.


--- Shawn



To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@xxxxxxxxxxxxxxxx


Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/perl-text-pdf-modules/

<*> To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/







Thread at a glance:

Previous Message by Date:

Re: Stamp on the wrong place/scale

hi! > Add on explanation: > >What I found in the stamped PDF is: > >stream > 583 0 0 841 0 0 cm >/Img1 Do > >endstream > >Why the hell is there cm ???? (that fits in what I see 5meters to 8meters) > nope, the operation is in points (cm = "set current matrix") so this is slightly smiller than "A4". write a script that demonstrates this and pack it up with your pdfs, right into may email folder. cheers, -- __ _ / _|_ __ ___ __| | ___ unix, linux, freebsd | |_| '__/ _ \/ _` |/ _ \ jpeg, png, gif, ppm | _| | | __/ (_| | (_) | apache, perl, php, mysql |_| |_| \___|\__,_|\___/ pdf, ps, abw, html, pod To unsubscribe from this group, send an email to: perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@xxxxxxxxxxxxxxxx Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/perl-text-pdf-modules/ <*> To unsubscribe from this group, send an email to: perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

Next Message by Date:

Re: AW: infinite loop in text->paragraph (0.40.91)

On Wednesday, February 16, 2005, at 03:25 AM, Markus Maier wrote: Okay, I got the point, thanks. But is there any non-developer way for using paragraphs in the current release?   Markus Hi, Aside from rolling your own, no. --- Shawn

Previous Message by Thread:

infinite loop in text->paragraph (0.40.91)

Hi, I got stuck here after upgrading from 0.30r77 to 0.40.91. The following code worked fine under 0.30r77 but ends up in an infinite loop in the text->paragraph method under 0.40.91. ---------- #!/usr/bin/perl -w use strict; use PDF::API2; my $pdf = PDF::API2->new(-file => 'test.pdf'); my $page = $pdf->page(); my $text = $page->text(); my $font = $pdf->corefont('Verdana', -encode => 'latin1'); $text->font($font, 8); $text->paragraph("Hello, just a test."x10, -x => 300, -y => 600, -h => 600, -w => 200); $pdf->save(); exit(); ---------- Anyone any idea? Cheers, Markus To unsubscribe from this group, send an email to: perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@xxxxxxxxxxxxxxxx Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/perl-text-pdf-modules/ <*> To unsubscribe from this group, send an email to: perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

Next Message by Thread:

Re: AW: infinite loop in text->paragraph (0.40.91)

On Wednesday, February 16, 2005, at 03:25 AM, Markus Maier wrote: Okay, I got the point, thanks. But is there any non-developer way for using paragraphs in the current release?   Markus Hi, Aside from rolling your own, no. --- Shawn
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!