Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: PDF and Line Wraping

by LostS (Friar)
on Oct 08, 2001 at 23:16 UTC ( [id://117531]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://117531]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found