This is some kind of notepad where I write down ideas, code snippets and other thoughts. Its main focus is on Java.
Testing Coroutines — Update 1.6.0
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
About one year ago I wrote some articles describing the Kotlin Coroutines Testing module. With the recent 1.6.0 release things changed significantly, so it’s time for an update.
Read the article on medium...
More than a decade ago I was using iText to create PDF documents from scratch. It was quite easy to use, and did all the stuff I needed like organizing text in paragraphs, performing word wrapping and marking up text with bold and italic. But once upon a time Bruno Lowagie - the developer of iText - switched from open source to a proprietary license for reasons I do understand . So when I now had to do some PDF processing for a new project, I was looking for an alternative. PDFBox is definitely the best open source choice, since it is quite mature.But when I was searching on how to do layout, I found a lot of people looking for exactly those features, and the common answer was: you have to do it on your own! Say what? Ouch. There must be someone out there, who already wrote that stuff... Sure there is, but google did not find him. So I started to write some simple word wrapping. And some simple pagination. And some simple markup for easy highlighting with bold an italic. Don't
One thing that made HTML so successful is the hyperlink. Keywords are marked up, and just by clicking on them, you are redirected to the refrerenced position in the document, or even to some totally different document. So it makes perfect sense to use hyperlinks in PDF documents also. Whether you are linking the entries of a TOC to the corresponding chapter, or a piece of information to a corresponding URL in wikipedia. Linking text enriches the content, and makes it more usable. Luckily PDF (and PDFBox ) supports hyperlinks, so why not use it? Because it's a pain. The PDF standard has no notion of marked up text, but the more general and abstract idea of annotated areas: You can describe some area in the document by coordinates, and add some metadata telling the PDF reader what to do with that area. That's quite powerful. You can do highlighting and all kinds of actions with that, and totally independant of the content, just by describing an area. And that's also the ca
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
Comments
Post a Comment