Skip to content

Meta and Text Alignment

Latest
Compare
Choose a tag to compare
@famoser famoser released this 02 Jan 13:52

This release adds machine-readable meta data to the PDF in the form of dublincore elements.

$meta = Meta::basic('en', 'My little PDF', ['Me', 'Myself', '& I']);
$document = new Document(meta: $meta);

Further, the text rendering has been improved, and now notably supports alignment:

$text = new Text(alignment: Text\Alignment::ALIGNMENT_JUSTIFIED);
$text->addSpan('This text is broken automatically into several lines, and then justified to avoid whitespace at the column boundary.', $textStyle);
$document->add($text);

As part of this release, the Printer and Document APIs have been clarified: The first is to print content (rectangles, images) at a predetermined position, while the second measures and allocates more complex layout elements (tables, grids, text) automatically.