Name

packer->new_page -- create a new page and track free space on it

Synopsis

int packer->new_page ( [string size] )

Description

This function creates a new page of the size specified by size (or the default page size if no size is specified) and returns a page id that must be used to paint to the page.

See new_page() for details on page size specification.

The default margins at the time of page creation will determine the usable area the packer considers. As calls to packer->allocate() (or a function that subsequently calls it) are made, that free space is adjusted to track the remaining free space on the page. Other packer functions will allow automatically discovering and using free space.

Only pages created with the packer's version of new_page() will have a free space map that the packer can use. Don't use the standard new_page() if you plan on using the packer.

Examples

See example-packer.php in the examples directory.

See Also

History

Added with the packer in 2.6

Bugs

None known