Skip to content

LayoutEngine

Compare
Choose a tag to compare
@famoser famoser released this 08 Jul 09:51
· 171 commits to main since this release
7d264ca

This adds support for a layout engine.

Place content as part of a layout (recursively!), and let the pdf-generator decide where to place it. This is useful for content of unknown size; e.g. a large text which spans over multiple pages:

$paragraph = new Paragraph();
$paragraph->add($normalText, "Long text");

$flow = new Flow();
$flow->addContent($paragraph);

$document->add($flow);

Supported in this release are flows (place content horizontally or vertically one-after-the-other) and simple blocks (add padding, margin etc to the inner block/content).

As part of this release, the direct printing API has been reworked, too. This remains useful for content where you know the placement (e.g. the address of an invoice).