in reply to download an array of text as pdf
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: download an array of text as pdf
by ajaykannan (Novice) on Dec 02, 2016 at 18:50 UTC | |
by poj (Abbot) on Dec 02, 2016 at 19:55 UTC | |
by ajaykannan (Novice) on Dec 07, 2016 at 14:38 UTC | |
by poj (Abbot) on Dec 07, 2016 at 17:02 UTC | |
by ajaykannan (Novice) on Dec 07, 2016 at 22:58 UTC | |
|