in reply to Re: download an array of text as pdf
in thread download an array of text as pdf

thank you for the help and can you tell me how to increase the width to print the data. Because for now its printing full content but only half are visible.

Replies are listed 'Best First'.
Re^3: download an array of text as pdf
by poj (Abbot) on Dec 02, 2016 at 19:55 UTC

    Reduce the font size, rotate the page to landscape or try this.

    #!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() ->font($font, 20); $text->lead(25); $text->translate(100, 700); while (<DATA>){ $text->paragraph($_, 400, 400, -align => "left" ); # width height $text->cr(-5); } $pdf->saveas($save_pdf_as); __DATA__ line 1 is a very long line that extends past the end of the page line 2 is also very long line that extends past the end of the page line 3 line 4

    The height of the paragraph box needs to be large enough for the text

    If you need to spread the text across multiple pages then it can get complicated !

    poj

      thank you poj once again for helping me. The goal is to spread the text across multiple pages. And please help me out from this.please

        What is the max number of characters you would ever expect in one line of data ?.
        What is the smallest font you can have ?

        poj