The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::PDF::API - a wrapper api for the Text::PDF::* modules of Martin Hosken.

SYNOPSIS

        use Text::PDF::API;

        $pdf = Text::PDF::API->new( %defaults );

        $pdf->end;

DESCRIPTION

Methods

$pdf = Text::PDF::API->new [%defaults]

This creates a new pdf-object initializes it with the given defaults and returns it. See the functions getDefault and setDefault for a list of supported parameters.

$pdf->saveas $file

This saves the pdf-object to a file indicated by $file.

$pdf->end

This destroys the pdf-object and frees its memory.

$pdf->getDefault $parameter

This returns the pdf-object default indicated by $parameter.

The current supported defaults are:

        PageSize, valid values:
        'a0'            =>      [ 2380  , 3368  ]
        'a1'            =>      [ 1684  , 2380  ]
        'a2'            =>      [ 1190  , 1684  ]
        'a3'            =>      [ 842   , 1190  ]
        'a4'            =>      [ 595   , 842   ]
        'a5'            =>      [ 421   , 595   ]
        'a6'            =>      [ 297   , 421   ]
        'letter'        =>      [ 612   , 792   ]
        'broadsheet'    =>      [ 1296  , 1584  ]
        'ledger'        =>      [ 1224  , 792   ]
        'tabloid'       =>      [ 792   , 1224  ]
        'legal'         =>      [ 612   , 1008  ]
        'executive'     =>      [ 522   , 756   ]
        '36x36'         =>      [ 2592  , 2592  ]

        PageWidth, valid values:
        0 .. 32535 points (remember default = 72dpi)
                
        PageHeight, valid values:
        0 .. 32535 points (remember default = 72dpi)

        Compression
        0, 1 (= off, on)

        PDFVersion
        0 .. 3 (corresponding to the abode acrobat versions 1 .. 4)
$pdf->setDefault $parameter , $value

This sets the pdf-object defaults (see $pdf->getDefault for details).

$pdf->newpage [ $width , $height ] OR $pdf->newpage [ $size ]

This creates a new page in the pdf-object and assigns it to the default page context. If $width and $height are not given the funtion falls back to any given defaults (PageSize then PageWidth+PageHeight) and as a last resort to 'A4'.

$pdf->endpage

This removes the current page context.

$pdf->getPageContext

This returns the current PageContext.

$pdf->setPageContext [ $context ]

1 POD Error

The following errors were encountered while parsing the POD:

Around line 392:

=over without closing =back