public int addPatterns() throws IOException {
  if (paintList.size() > 0) {
    PDFDictionary patterns=pdf.openDictionary("Pattern");
    ListIterator<Entry> i=paintList.listIterator();
    while (i.hasNext()) {
      Entry e=(Entry)i.next();
      patterns.entry(e.name,pdf.ref(e.name));
    }
    pdf.close(patterns);
  }
  return paintList.size();
}

public int addPatterns ( ) throws IOException { if ( paintList . size ( ) > 0 ) { PDFDictionary patterns = pdf . openDictionary ( "Pattern" ) ; ListIterator < Entry > i = paintList . listIterator ( ) ; while ( i . hasNext ( ) ) { Entry e = ( Entry ) i . next ( ) ; patterns . entry ( e . name , pdf . ref ( e . name ) ) ; } pdf . close ( patterns ) ; } return paintList . size ( ) ; }
adds all names to the dictionary which should be the value of the resources dicionrary ' s / pattern entry .
