document.getPages().add(page); // Puts the page in the pages collection.
Dimension2D pageSize = page.getSize();
PrimitiveComposer composer = new PrimitiveComposer(page);
// Add the background template!
composer.showXObject(template);
// Wrap the content composer inside a block composer in order to achieve higher-level typographic control!
/*
NOTE: BlockComposer provides block-level typographic features as text and paragraph alignment.
Flow-level typographic features are currently not supported: block-level typographic features
are the foundations upon which flow-level typographic features will sit.