in reply to Re: Re: PDF and Line Wraping
in thread PDF and Line Wraping

I had to do a similar thing with pdflib

With Text::Wrap and Text::ParseWords...
@lines = parse2array($doc,"\s");
$wrap = wrap(" ","", @lines), "\n";
@lines = parse2array($wrap,"\n");


This wrapped the text nicely in an array
so I could deal with the in-house pdf
formatting constructs.


here's the parse2array subroutine
sub parse2array { return quotewords($_[1],0,$_[0]); }

This is via the Cookbook 1.15 recipe
cheers...

Replies are listed 'Best First'.
Re: Re: PDF and Line Wraping
by LostS (Friar) on Oct 09, 2001 at 00:11 UTC
    Ummm... what is the subroutine for parse2array???

    -----------------------
    Billy S.
    Slinar Hardtail - Guildless
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster
    Aerynth.Net Admin/WebMaster

    perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'
Re: Re: PDF and Line Wraping
by LostS (Friar) on Oct 09, 2001 at 18:46 UTC
    Thank you :)
    Your suggestion works like a charm... I really appricate you mentioning where you got it cause you kind of forgot to say you also needed to use the module Text::ParseWords... :) But it is all good and I can now dynamicall generate a PDF on the fly :) Without creating a Latex or Text file first :)


    -----------------------
    Billy S.
    Slinar Hardtail - Guildless
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster
    Aerynth.Net Admin/WebMaster

    perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'