question: 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 ) ; } } }
target:  Merges two dictionaries. When both dictionaries contain the same key, the value from the first dictionary is kept.