I have been trying (unsuccessfully I m ight add) to create paragraphs, I
know it can be done but I have yet to get it to work, here are a few
snippets trying to create it neither work

 

use PDF::API2;

use perlchartdir;

use strict;

use warnings;

 

use constant mm => 25.4/72;

use constant in =>    1/72;

use constant pt =>    1;

 

my $Template = "Dell_Deployment_Optimization.pdf";

 

my $pdftable = new PDF::Table;

 my $pdf = new PDF::API2("testme.pdf");

my $page = $pdf->page;

my $txt = $pdf->text;

 

my $paragraph = "hfsdhfash jklshf jkshdf sjfh asjf jlkhasdf shf kljashf
kjhasd jklhsdfsahfash asfhf ash sfkjh v,nn zxn vkhn n gfoi dfkh vh akdfh
ihzdh klhdkh khgdhfiofjfjfas m, noncv shfhf hshff sdhfshfioshf hsdfs";

 

my $font = $pdf->corefont("Helvetica");

my $lead = 10;

my $fontsize = 12;

my $x = 50;

my $y = 50;

my $width = 300;

my $bottom_margin= 20;

 

$txt = $pdf->font($font,$fontsize);

$txt = $pdf->lead($lead);

$txt = $pdf->translate($x,$y);

my $overflow = $pdf->paragraph( $paragraph,  $width,
$y+$lead-$bottom_margin );

 

print $pdf->stringify;

binmode STDOUT;

 

$pdf->end;

 

 

 

also this code for API2, and I have yet figured out how to get it to
work

 

 

($width_of_last_line, $ypos_of_last_line, $left_over_text) =
$pdftable->text_block(

    $txt,

    $text_to_place,

    #X,Y - coordinates of upper left corner

    x        => $left_edge_of_block,

    y        => $y_position_of_first_line,

    w        => $width_of_block,

    h        => $height_of_block,

    #OPTIONAL PARAMS

    lead     => $font_size | $distance_between_lines,

    align    => "left|right|center|justify|fulljustify",

    hang     => $optional_hanging_indent,

    Only one of the subsequent 3params can be given. 

    They override each other.-parspace is the weightest

    parspace => $optional_vertical_space_before_first_paragraph,

    flindent => $optional_indent_of_first_line,

    fpindent => $optional_indent_of_first_paragraph,

 

    indent   => $optional_indent_of_text_to_every_non_first_line,

 );

 

 

everytime I try to use these it either fails, or tells me to download
the .pl file,....any help would be great

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to