Try setting the line spacing (leading) and adding newlines. You can also set the line spacing within the cr method. For example
poj#!perl use strict; use warnings; use PDF::API2; my $save_pdf_as = "mypdf.pdf"; my $pdf = PDF::API2->new(); my $page = $pdf->page() ->mediabox('Letter'); my $font = $pdf->corefont('Helvetica-Bold'); my $text = $page->text(); $text->lead(25); $text->font($font, 20); $text->translate(100, 700); while (<DATA>){ $text->text($_); $text->cr(); #$text->cr(-25); # move down } $pdf->saveas($save_pdf_as); __DATA__ line 1 line 2 line 3 line 4
In reply to Re: download an array of text as pdf
by poj
in thread download an array of text as pdf
by ajaykannan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |