private void mergeResources(PdfDictionary result,PdfDictionary source){
  for (  PdfName name : resourceNames) {
    PdfDictionary dic=source.getAsDictionary(name);
    PdfDictionary res=result.getAsDictionary(name);
    if (res == null) {
      res=new PdfDictionary();
    }
    if (dic != null) {
      res.mergeDifferent(dic);
      result.put(name,res);
    }
  }
}

private void mergeResources ( PdfDictionary result , PdfDictionary source ) { for ( PdfName name : resourceNames ) { PdfDictionary dic = source . getAsDictionary ( name ) ; PdfDictionary res = result . getAsDictionary ( name ) ; if ( res == null ) { res = new PdfDictionary ( ) ; } if ( dic != null ) { res . mergeDifferent ( dic ) ; result . put ( name , res ) ; } } }
merges two dictionaries . when both dictionaries contain the same key , the value from the first dictionary is kept .
