Posts

Showing posts from June, 2016

Creating Lists with PDFBox-Layout

Image
The last article gave you a brief introduction on what you can do with PDFBox-Layout. The new release 0.6.0 added support for indentation and lists, and that’s what this article is about. Indentation Indentation is often used to structure content, and it is also the base for creating lists. Let’s start with some simple example using the Indent element. paragraph.addMarkup( "This is an example for the new indent feature. Let's do some empty space indentation:\n", 11, BaseFont.Times); paragraph.add(new Indent(50, SpaceUnit.pt)); paragraph.addMarkup("Here we go indented.\n", 11, BaseFont.Times); paragraph.addMarkup( "The Indentation holds for the rest of the paragraph, or... \n", 11, BaseFont.Times); paragraph.add(new Indent(70, SpaceUnit.pt)); paragraph.addMarkup("any new indent comes.\n", 11, BaseFont.Times); So what do we do here: we add an indent of 50pt width. This indent will be automatically inserted after ea