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

Hey

Well I also got it working via Text::Wrap also... However... I need to do this everytime it has a new line... $loc -= 14;

What do you all think I can do??

-----------------------
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";'

Replies are listed 'Best First'.
Re: PDF and Line Wraping
by jujubee (Acolyte) on Oct 08, 2001 at 23:55 UTC
    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...
      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";'
      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";'