generate -- Create a PDF document
string generate ( [int compression] )
This function takes all the objects that have been created in the library and, using all current settings, returns the document in the PDF format. The single (optional) parameter indicates the level of compression used. It defaults to 9 if omitted
Echos the PDF file to the client:
echo $pdf->generate();
Stores the PDF in a variable uncompressed for later use:
$doc = $pdf->generate(0);
Version 2 of the library added the compression parameter.
Multiple calls to generate
are not supported.
It is recommended that if script execution is to continue after the
call to generate
, that the library object be unset to
reduce memory usage.