To improve the readability and to ease maintenance of the PDFBox code there are a small number of coding conventions.
Use 4 spaces for indentation. No tabs!
Place open braces on the line after the declaration, for example:
public class Foo extends Bar { public static void main(String args[]) { try { for (int i = 0; i < args.length; i++) { System.out.println(Integer.parseInt(args[i])); } } catch(NumberFormatException e) { e.printStackTrace(); } } }
Wrap lines longer than 100 characters. For wrapped lines, either use an indent of 8 characters or align with the expression at the same level on the previous line.
Within a class or interface, definitions should be ordered as follows:
Do not use package imports (for example import import java.util.*;)
For other cases, we try to follow Sun's code conventions as much as possible.
Eclipse users may download this preferences file: pdfbox-checkstyle-5.xml and import this into Eclipse. (Window->Preferences, go to Java->Code Style->Formatter and click "Import..."). Once you have done this you can reformat your code by using Source->Format (Ctrl+Shift+F).
Also note that Eclipse will automatically format your import statements appropriately when you invoke Source -> Organize Imports (Ctrl+Shift+O).