code: public void setSortOrder(boolean[] ascending) {
  		PdfObject o = get(PdfName.S);
  		if (o instanceof PdfArray) {
  			if (((PdfArray)o).size() != ascending.length) {
  				throw new IllegalArgumentException("The number of booleans in this array doesn't correspond with the number of fields.");
  			}
  			PdfArray array = new PdfArray();
  			for (int i = 0; i < ascending.length; i++) {
  				array.add(new PdfBoolean(ascending[i]));
  			}
  			put(PdfName.A, array);
  		}
  		else {
  			throw new IllegalArgumentException("You need a single boolean for this collection sort dictionary.");
  		}
  	}
docs: Defines the sort order of the field (ascending or descending).
  @param ascending	an array with every element corresponding with a name of a field.