Name

generate -- Create a PDF document

Synopsis

string generate ( [int compression] )

Description

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

Examples

Echos the PDF file to the client:

echo $pdf->generate();

Stores the PDF in a variable uncompressed for later use:

$doc = $pdf->generate(0);

See Also

History

Version 2 of the library added the compression parameter.

Bugs

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.