in reply to Re^3: Text::Wrap not working
in thread Text::Wrap not working

Hi toolic:

Your original example did not work for me. Many of the variables are being passed via html user input. Thus message is:

$message = $q->param('message');

Message is obtained from a textarea box that is embedded on an image and is sent via sendmail in the cgi. The problem is the text is not wrapping in the image box.

Replies are listed 'Best First'.
Re^5: Text::Wrap not working
by Khen1950fx (Canon) on Aug 24, 2010 at 06:18 UTC
    GD::Text::Wrap is frequently used with CGI. Maybe you should try it. For example:
    #!/usr/bin/perl use strict; use warnings; use GD; use GD::Text::Wrap; my $gd = GD::Image->new(800,600); my $text = <<EOSTR; This is the way it is. This is the way it was. EOSTR my $wrapbox = GD::Text::Wrap->new( $gd, text => $text); $wrapbox->set_font(gdMediumBoldFont); $wrapbox->set_font('arial', 12); $wrapbox->set(align => 'left', width => 40); $wrapbox->draw(10, 140); print "\n$text\n";
Re^5: Text::Wrap not working (CGI)
by toolic (Bishop) on Aug 23, 2010 at 21:29 UTC