---
title: "init(RTFDFileWrapper:documentAttributes:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsattributedstring/init(rtfdfilewrapper:documentattributes:)"
---

# init(RTFDFileWrapper:documentAttributes:)

Creates an attributed string from the specified file wrapper that contains an RTFD document.

## Declaration

```swift
init?(RTFDFileWrapper wrapper: FileWrapper, documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)
```

```swift
init?(rtfdFileWrapper wrapper: FileWrapper, documentAttributes dict: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)
```

## Parameters

- `wrapper`: The doc://com.apple.foundation/documentation/Foundation/FileWrapper containing the RTFD document.
- `dict`: An in-out dictionary containing document-level attributes. On output, this method updates the dictionary to contain any document-specific keys found in the data. Specify nil if you don’t want the document attributes.

## Return Value

Return Value Returns an initialized attributed string object, or nil if the method can’t decode the data.

## Discussion

Discussion Also returns by reference in dict a dictionary containing document-level attributes described in NSAttributedString.DocumentAttributeKey. dict may be NULL, in which case no document attributes are returned. Returns an initialized object, or nil if wrapper can’t be interpreted as an RTFD document.

## See Also

### Creating from RTF

- [init(RTF:documentAttributes:)](foundation/nsattributedstring/init(rtf:documentattributes:).md)
- [init(RTFD:documentAttributes:)](foundation/nsattributedstring/init(rtfd:documentattributes:).md)
