# set method

void set(

1. String? key,
2. DocumentInfo documentInfoItem

)

Sets an item of the DocumentInfoDictionary object.

param key Unique key of the DocumentInfo item to set. param documentInfoItem DocumentInfo item to set. throws DocumentException An error has occurred during Document Library execution.

## Implementation

    void set(String? key, DocumentInfo documentInfoItem) {
      Pointer<Char>? pKey = key?.toNativeUtf8().cast<Char>();
      try {
        var err = documentSDK.id3DocumentInfoDictionary_Set(_pHandle.value, pKey ?? nullptr, documentInfoItem.handle);
        if (err != DocumentError.success.value) {
          throw DocumentException(err);
        }
      } finally {
        if (pKey != null) {
          calloc.free(pKey);
        }
      }
    }